{"action":"opened","issue":{"url":"https://api.github.com/repos/npm/npm/issues/14338","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/14338/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/14338/comments","events_url":"https://api.github.com/repos/npm/npm/issues/14338/events","html_url":"https://github.com/npm/npm/issues/14338","id":183930142,"number":14338,"title":"npm shebang line is incorrect when using directly on multi-node environment","user":{"login":"arkady-emelyanov","id":285566,"avatar_url":"https://avatars.githubusercontent.com/u/285566?v=3","gravatar_id":"","url":"https://api.github.com/users/arkady-emelyanov","html_url":"https://github.com/arkady-emelyanov","followers_url":"https://api.github.com/users/arkady-emelyanov/followers","following_url":"https://api.github.com/users/arkady-emelyanov/following{/other_user}","gists_url":"https://api.github.com/users/arkady-emelyanov/gists{/gist_id}","starred_url":"https://api.github.com/users/arkady-emelyanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkady-emelyanov/subscriptions","organizations_url":"https://api.github.com/users/arkady-emelyanov/orgs","repos_url":"https://api.github.com/users/arkady-emelyanov/repos","events_url":"https://api.github.com/users/arkady-emelyanov/events{/privacy}","received_events_url":"https://api.github.com/users/arkady-emelyanov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-19T10:59:35Z","updated_at":"2016-10-19T10:59:35Z","closed_at":null,"body":"#### System-wide Node.js and npm install\r\n\r\n  - [+] npm is producing an incorrect install.\r\n\r\n#### What's going wrong?\r\n\r\nConsider this:\r\n * System-wide Node.js version 0.10.36\r\n * Project level Node.js version 6.x\r\n\r\n```bash\r\n$ node --version \r\nv0.10.36\r\n$ npm --version\r\n1.3.6\r\n$ /opt/node-v6.8.1-linux-x64/bin/node --version\r\nv6.8.1\r\n$ /opt/node-v6.8.1-linux-x64/bin/npm --version\r\n3.10.8\r\n```\r\n\r\nInstall script calling `npm i` like this:\r\n```bash\r\n$ cd project\r\n$ /opt/node-v6.8.1-linux-x64/bin/npm i\r\n```\r\n\r\nProblem with shebang line of npm: (https://github.com/npm/npm/blob/master/bin/npm-cli.js#L1)\r\n`#!/usr/bin/env node`. \r\n\r\nIn most cases, installation will be correct, unless project is using C++ modules. In this case, module build using system-wide node.js, which cause `module did not self-register` error on project start.\r\n\r\nBehaviour is unexpected, since npm itself is a correct relative symlink.\r\nThe workaround is run `npm i` using project Node.js:\r\n\r\n```bash\r\n$ /opt/node-v6.8.1-linux-x64/bin/node /opt/node-v6.8.1-linux-x64/bin/npm i\r\n```\r\n\r\nExpected behaviour:\r\nnpm uses relative path to locate Node.js binary."}}
{"actor":{"display_login":"arkady-emelyanov"}}