{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/8304","labels_url":"https://api.github.com/repos/npm/npm/issues/8304/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/8304/comments","events_url":"https://api.github.com/repos/npm/npm/issues/8304/events","html_url":"https://github.com/npm/npm/issues/8304","id":77984260,"number":8304,"title":"npm install with prefix","user":{"login":"chrismcv","id":145466,"avatar_url":"https://avatars.githubusercontent.com/u/145466?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismcv","html_url":"https://github.com/chrismcv","followers_url":"https://api.github.com/users/chrismcv/followers","following_url":"https://api.github.com/users/chrismcv/following{/other_user}","gists_url":"https://api.github.com/users/chrismcv/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismcv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismcv/subscriptions","organizations_url":"https://api.github.com/users/chrismcv/orgs","repos_url":"https://api.github.com/users/chrismcv/repos","events_url":"https://api.github.com/users/chrismcv/events{/privacy}","received_events_url":"https://api.github.com/users/chrismcv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/support","name":"support","color":"FF91AF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-19T08:02:21Z","updated_at":"2015-07-06T03:38:58Z","closed_at":null,"body":"I'm trying to lay out a project structure with multiple local packages, I'd like them to share the same node_modules folders so that npm install is fast, and disk space usage is moderate. Each package when used standalone has a few hundred MB of dependencies.\r\n\r\n```\r\nnode_modules\r\nmain\r\n  - package.json\r\npackages\r\n  lib1\r\n    - package.json\r\n  lib2\r\n    - package.json\r\n```\r\n\r\nAs an example each package depends on react, gulp and webpack, which will be defined as dependencies in each package.json.\r\n\r\nI'm trying to work out how to have an easy script to install each packages dependencies into node_modules, but I can't make it work.\r\n\r\n```\r\ncd main\r\necho \"prefix = ..\" > .npmrc\r\nnpm install \r\nfor each in packages\r\n  cd package\r\n  echo \"cat prefix = ..\" > .npmrc\r\n  npm install\r\n```\r\n\r\nHowever, I can't make it work.\r\n\r\nnpm install --prefix .. also doesn't work without a package name, but as I'm trying to make this install all packages after a clone, it doesn't work.\r\n\r\nUsing local dependencies e.g. `\"lib1\": \"./path/to/lib1\"` seems to create copies of `lib1` rather than installing lib1's dependencies."},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/118706325","html_url":"https://github.com/npm/npm/issues/8304#issuecomment-118706325","issue_url":"https://api.github.com/repos/npm/npm/issues/8304","id":118706325,"user":{"login":"iarna","id":983798,"avatar_url":"https://avatars.githubusercontent.com/u/983798?v=3","gravatar_id":"","url":"https://api.github.com/users/iarna","html_url":"https://github.com/iarna","followers_url":"https://api.github.com/users/iarna/followers","following_url":"https://api.github.com/users/iarna/following{/other_user}","gists_url":"https://api.github.com/users/iarna/gists{/gist_id}","starred_url":"https://api.github.com/users/iarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iarna/subscriptions","organizations_url":"https://api.github.com/users/iarna/orgs","repos_url":"https://api.github.com/users/iarna/repos","events_url":"https://api.github.com/users/iarna/events{/privacy}","received_events_url":"https://api.github.com/users/iarna/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T03:38:58Z","updated_at":"2015-07-06T03:38:58Z","body":"Related to #8036"}}