{"action":"opened","issue":{"url":"https://api.github.com/repos/npm/npm/issues/14029","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/14029/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/14029/comments","events_url":"https://api.github.com/repos/npm/npm/issues/14029/events","html_url":"https://github.com/npm/npm/issues/14029","id":178444529,"number":14029,"title":"npm3 installs incorrect dependencies when updating using symlinks","user":{"login":"mlucool","id":1813603,"avatar_url":"https://avatars.githubusercontent.com/u/1813603?v=3","gravatar_id":"","url":"https://api.github.com/users/mlucool","html_url":"https://github.com/mlucool","followers_url":"https://api.github.com/users/mlucool/followers","following_url":"https://api.github.com/users/mlucool/following{/other_user}","gists_url":"https://api.github.com/users/mlucool/gists{/gist_id}","starred_url":"https://api.github.com/users/mlucool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlucool/subscriptions","organizations_url":"https://api.github.com/users/mlucool/orgs","repos_url":"https://api.github.com/users/mlucool/repos","events_url":"https://api.github.com/users/mlucool/events{/privacy}","received_events_url":"https://api.github.com/users/mlucool/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-21T19:44:54Z","updated_at":"2016-09-21T19:44:54Z","closed_at":null,"body":"#### I'm opening this issue because:\r\n\r\n  - [ ] npm is crashing.\r\n  - [X] npm is producing an incorrect install.\r\n  - [ ] npm is doing something I don't understand.\r\n  - [ ] Other (_see below for feature requests_):\r\n\r\n#### What's going wrong?\r\nWhen using symlinks and you change a the version of a dependency, npm will rightfully complain it will not update it, yet still installs new dependencies to it leaving the tree in a bad state.\r\n\r\nI.e. If I am dependent on v1 via symlink and npm install foo@v2 it will tell me that it cannot update but will then install all of v2's missing dependencies to v1 without updating v1.\r\n\r\nIt should never under any circumstance change the contents of the symlink, as the warning implies was the intention.\r\n\r\n#### How can the CLI team reproduce the problem?\r\nCreate the following:\r\nA directory called foo with the following package.json:\r\n```\r\nmkdir foo bar\r\necho '{\r\n  \"name\": \"foo\",\r\n  \"version\": \"1.0.0\",\r\n  \"dependencies\": {\r\n    \"babel\": \"^6.5.2\",\r\n    \"babel-core\": \"^6.14.0\",\r\n    \"jsdoc-babel\": \"^0.2.1\"\r\n  }\r\n}\r\n' > foo/package.json\r\necho '{\r\n   \"name\": \"bar\",\r\n   \"version\": \"1.0.0\",\r\n   \"dependencies\": {\r\n     \"jsdoc-babel\": \"^0.1.0\"\r\n   }\r\n }\r\n' > bar/package.json\r\ncd foo\r\nnpm install\r\ncd ../bar\r\nmkdir node_modules\r\ncd node_modules\r\nln -s ../../foo/node_modules/* .\r\ncd ..\r\nnpm install\r\n```\r\nThe output of this install includes:\r\n```\r\nnpm WARN update-linked node_modules/jsdoc-babel needs updating to 0.1.0 from 0.2.1 but we can't, as it's a symlink\r\nbar@1.0.0 /my/path/to/bar/bar\r\n\\u2514\\u2500\\u252c jsdoc-babel@0.1.0\r\n  \\u251c\\u2500\\u252c babel-core@5.8.38 \r\n  \\u2502 \\u251c\\u2500\\u2500 babel-plugin-constant-folding@1.0.1 \r\n  \\u2502 \\u251c\\u2500\\u2500 babel-plugin-dead-code-elimination@1.0.2 \r\n```\r\nWhich shows it is modifying the contents of the symlink!\r\nAs a note, the above is also wrong, jsdoc-babel is still v0.2.1:\r\n```\r\ngrep version node_modules/jsdoc-babel/package.json\r\n  \"version\": \"0.2.1\"\r\n```\r\n\r\n<!--\r\n    Please a complete description of how to reproduce the problem.\r\n    Include a gist of your npm-debug.log file.\r\n    If you've never used gist.github.com, start here:\r\n      https://github.com/EmmaRamirez/how-to-submit-your-npm-debug-log\r\n-->\r\n\r\n### supporting information:\r\nLinux\r\n - `npm -v` prints:  3.10.3\r\n - `node -v` prints: v6.5.0\r\n - `npm config get registry` prints:\r\n - Windows, OS X, or Linux?: Linux\r\n - Network issues:\r\n   - Geographic location where npm was run:\r\n   - [X] I use a proxy to connect to the npm registry.\r\n   - [ ] I use a proxy to connect to the web.\r\n   - [ ] I use a proxy when downloading Git repos.\r\n   - [ ] I access the npm registry via a VPN\r\n   - [ ] I don't use a proxy, but have limited or unreliable internet access.\r\n - Container:\r\n   - [ ] I develop using Vagrant on Windows.\r\n   - [ ] I develop using Vagrant on OS X or Linux.\r\n   - [ ] I develop / deploy using Docker.\r\n   - [ ] I deploy to a PaaS (Triton, Heroku).\r\n\r\n<!--\r\n    Thank you for contributing to npm! Please review this checklist\r\n    before submitting your issue.\r\n\r\n    - Please check if there's a solution in the troubleshooting wiki:\r\n      https://github.com/npm/npm/wiki/Troubleshooting\r\n\r\n    - Also ensure that your new issue conforms to npm's contribution guidelines:\r\n      https://github.com/npm/npm/wiki/Contributing-Guidelines\r\n\r\n    - Participation in this open source project is subject to the npm Code of Conduct:\r\n      https://www.npmjs.com/policies/conduct\r\n\r\n    For feature requests, delete the above and uncomment the section following this one. But first, review the existing feature requests\r\n    and make sure there isn't one that already describes the feature\r\n    you'd like to see added:\r\n      https://github.com/npm/npm/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+label%3Aalready-looked-at\r\n-->\r\n\r\n<!--\r\n\r\n#### What's the feature?\r\n\r\n#### What problem is the feature intended to solve?\r\n\r\n#### Is the absence of this feature blocking you or your team? If so, how?\r\n\r\n#### Is this feature similar to an existing feature in another tool?\r\n\r\n#### Is this a feature you're prepared to implement, with support from the npm CLI team?\r\n\r\n-->\r\n"}}
{"actor":{"display_login":"mlucool"}}