{"action":"created","issue":{"url":"https://api.github.com/repos/lerna/lerna/issues/1405","repository_url":"https://api.github.com/repos/lerna/lerna","labels_url":"https://api.github.com/repos/lerna/lerna/issues/1405/labels{/name}","comments_url":"https://api.github.com/repos/lerna/lerna/issues/1405/comments","events_url":"https://api.github.com/repos/lerna/lerna/issues/1405/events","html_url":"https://github.com/lerna/lerna/issues/1405","id":319270459,"number":1405,"title":"[Error on]: lerna add underscore --scope=@nsp/app","user":{"login":"SerkanSipahi","id":1880749,"avatar_url":"https://avatars2.githubusercontent.com/u/1880749?v=4","gravatar_id":"","url":"https://api.github.com/users/SerkanSipahi","html_url":"https://github.com/SerkanSipahi","followers_url":"https://api.github.com/users/SerkanSipahi/followers","following_url":"https://api.github.com/users/SerkanSipahi/following{/other_user}","gists_url":"https://api.github.com/users/SerkanSipahi/gists{/gist_id}","starred_url":"https://api.github.com/users/SerkanSipahi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SerkanSipahi/subscriptions","organizations_url":"https://api.github.com/users/SerkanSipahi/orgs","repos_url":"https://api.github.com/users/SerkanSipahi/repos","events_url":"https://api.github.com/users/SerkanSipahi/events{/privacy}","received_events_url":"https://api.github.com/users/SerkanSipahi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-01T17:46:46Z","updated_at":"2018-05-01T19:41:55Z","closed_at":null,"author_association":"NONE","body":"Im working on a Angular based application with Lerna. Everything works well. It can be bootstrapped, can up and running the angular app, running the angular test. So far so good but when using `lerna add underscore --scope=@nsp/app` it throw an error (see below lerna-debug.log)! While lerna trying to add the lib, it delete or break the node_modules structure so some libs are not there anymore!  \r\n\r\nI guess the error depends on my `lerna.json` (see below lerna.json)! Unfortunately i cant judge if it is a bug!\r\n\r\nI need that lerna.json (see below) configuration for a single reason and that's the following: minimum configuration on Angular side. \r\n\r\nI hope i could explain my issue.\r\n\r\nAngular 6 based project structure\r\n```\r\n.\r\n├── src\r\n│   ├── app\r\n│   ├── assets\r\n│   ├── packages\r\n│   │   └── foo\r\n│   │         └── package.json  (@nsp/foo)\r\n│   │   └── bar\r\n│   │         └── package.json  (@nsp/bar)\r\n├── package.json (@nsp/app) (this package should consume @nsp/foo and @nsp/bar)\r\n├── lerna.json\r\n```\r\nlerna.json\r\n```json\r\n{\r\n  \"packages\": [\r\n    \"./\",\r\n    \"./src/packages/*\"\r\n  ],\r\n  \"version\": \"0.0.0\"\r\n  }\r\n}\r\n```\r\n\r\n## Possible Solution\r\nNo solution because unfortunately i cant judge if it is a bug!\r\n\r\n<details><summary>lerna.json</summary><p>\r\n<!-- browsers demand the next line be empty -->\r\n\r\n```json\r\n{\r\n  \"packages\": [\r\n    \"./\",\r\n    \"./src/packages/*\"\r\n  ],\r\n  \"version\": \"0.0.0\"\r\n  }\r\n}\r\n```\r\n</p></details>\r\n\r\n<details><summary>lerna-debug.log</summary><p>\r\n<!-- browsers demand the next line be empty -->\r\n\r\n```txt\r\nlerna ERR! npm ERR! path node_modules/@honey.glass/matmedia/node_modules/ansi-styles\r\nlerna ERR! npm ERR! code ENOENT\r\nlerna ERR! npm ERR! errno -2\r\nlerna ERR! npm ERR! syscall rename\r\nlerna ERR! npm ERR! enoent ENOENT: no such file or directory, rename 'node_modules/@honey.glass/matmedia/node_modules/ansi-styles' -> 'node_modules/@angular-devkit/build-angular/node_modules/ansi-styles'\r\nlerna ERR! npm ERR! enoent This is related to npm not being able to find a file.\r\nlerna ERR! npm ERR! enoent \r\n\r\n```\r\n</p></details>\r\n\r\n## Context\r\n<!--- How has this issue affected you? What are you trying to accomplish? -->\r\n<!--- Providing context helps us come up with a solution that is most useful in the real world -->\r\n\r\n## Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n| Executable | Version |\r\n| ---: | :--- |\r\n| `lerna --version` | v3.0.0-beta.18 |\r\n| `npm --version`  | v5.5.1 |\r\n| `node --version` | v9.3.0 |\r\n\r\n| OS | Version |\r\n| --- | --- |\r\n| NAME | VERSION |\r\n| macOS El Capitan | 10.11.6 |\r\n"},"comment":{"url":"https://api.github.com/repos/lerna/lerna/issues/comments/385768260","html_url":"https://github.com/lerna/lerna/issues/1405#issuecomment-385768260","issue_url":"https://api.github.com/repos/lerna/lerna/issues/1405","id":385768260,"user":{"login":"evocateur","id":5605,"avatar_url":"https://avatars3.githubusercontent.com/u/5605?v=4","gravatar_id":"","url":"https://api.github.com/users/evocateur","html_url":"https://github.com/evocateur","followers_url":"https://api.github.com/users/evocateur/followers","following_url":"https://api.github.com/users/evocateur/following{/other_user}","gists_url":"https://api.github.com/users/evocateur/gists{/gist_id}","starred_url":"https://api.github.com/users/evocateur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evocateur/subscriptions","organizations_url":"https://api.github.com/users/evocateur/orgs","repos_url":"https://api.github.com/users/evocateur/repos","events_url":"https://api.github.com/users/evocateur/events{/privacy}","received_events_url":"https://api.github.com/users/evocateur/received_events","type":"User","site_admin":false},"created_at":"2018-05-01T19:41:55Z","updated_at":"2018-05-01T19:41:55Z","author_association":"OWNER","body":"> I guess in this constellation lerna and npm dont work well together.\r\n\r\nIt's not lerna & npm specifically, it's configuring the root package.json to _also_ be a lerna-published package (one reason I don't recommend this pattern). The root manifest should only be used for hoisting `devDependencies` and build/test scripts, and all packages should live elsewhere, as configured in the `packages` array of lerna.json."}}
{"actor":{"display_login":"evocateur"}}