{"action":"created","issue":{"url":"https://api.github.com/repos/joyent/node/issues/13861","labels_url":"https://api.github.com/repos/joyent/node/issues/13861/labels{/name}","comments_url":"https://api.github.com/repos/joyent/node/issues/13861/comments","events_url":"https://api.github.com/repos/joyent/node/issues/13861/events","html_url":"https://github.com/joyent/node/issues/13861","id":64111536,"number":13861,"title":"zsh: permission denied: npm","user":{"login":"tyduptyler13","id":1331209,"avatar_url":"https://avatars.githubusercontent.com/u/1331209?v=3","gravatar_id":"","url":"https://api.github.com/users/tyduptyler13","html_url":"https://github.com/tyduptyler13","followers_url":"https://api.github.com/users/tyduptyler13/followers","following_url":"https://api.github.com/users/tyduptyler13/following{/other_user}","gists_url":"https://api.github.com/users/tyduptyler13/gists{/gist_id}","starred_url":"https://api.github.com/users/tyduptyler13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyduptyler13/subscriptions","organizations_url":"https://api.github.com/users/tyduptyler13/orgs","repos_url":"https://api.github.com/users/tyduptyler13/repos","events_url":"https://api.github.com/users/tyduptyler13/events{/privacy}","received_events_url":"https://api.github.com/users/tyduptyler13/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joyent/node/labels/npm","name":"npm","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-24T22:07:10Z","updated_at":"2015-03-25T05:20:08Z","closed_at":null,"body":"After installing the latest build of nodejs, npm no longer works due to what appears to be a permission issue. zsh seems to know the file exists on the path but doesn't know where it is and refuses to execute it. For example:\r\n\r\n```\r\ntyler@MasterMyUPlay ~ % where npm\r\nnpm not found\r\ntyler@MasterMyUPlay ~ % ll\r\nzsh: command not found: ll\r\ntyler@MasterMyUPlay ~ % npm\r\nzsh: permission denied: npm\r\n```\r\n\r\nThis shows that is knows the difference between a command that doesn't exist and one that does. However it doesn't want to show where npm is and refuses to execute it.\r\n\r\nI did a [recursive list](https://gist.github.com/tyduptyler13/288d781b0ae78b8d0243) of all of the permissions in the /usr/local/lib/node_modules directory. Hopefully that will help.\r\n\r\nI have already tried deleting and re-installing the relevant directories but it results in the exact same permissions.\r\n"},"comment":{"url":"https://api.github.com/repos/joyent/node/issues/comments/85845070","html_url":"https://github.com/joyent/node/issues/13861#issuecomment-85845070","issue_url":"https://api.github.com/repos/joyent/node/issues/13861","id":85845070,"user":{"login":"othiym23","id":418097,"avatar_url":"https://avatars.githubusercontent.com/u/418097?v=3","gravatar_id":"","url":"https://api.github.com/users/othiym23","html_url":"https://github.com/othiym23","followers_url":"https://api.github.com/users/othiym23/followers","following_url":"https://api.github.com/users/othiym23/following{/other_user}","gists_url":"https://api.github.com/users/othiym23/gists{/gist_id}","starred_url":"https://api.github.com/users/othiym23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othiym23/subscriptions","organizations_url":"https://api.github.com/users/othiym23/orgs","repos_url":"https://api.github.com/users/othiym23/repos","events_url":"https://api.github.com/users/othiym23/events{/privacy}","received_events_url":"https://api.github.com/users/othiym23/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T05:20:07Z","updated_at":"2015-03-25T05:20:07Z","body":"@tyduptyler13: I'm not sure how this happened, but I at least know what the problem is:\r\n\r\n```\r\n./npm/bin:\r\n...\r\n-rwx-----T 1 root root  340 Jun 18  2014 npm\r\n-rwx-----T 1 root root 1887 Mar 24 15:44 npm-cli.js\r\n```\r\n\r\nSomehow, npm and `npm-cli.js` have become executable solely by root. In addition, that `T` is problematic:\r\n\r\n> If the sticky-bit is set on a file or directory without the execution bit set for the others category (non-user-owner and non-group-owner), it is indicated with a capital T\r\n\r\nHow did you install Node.js / npm? Something in the process stomped on the permissions in `/usr/local/lib/node_modules` in the process of installing everything.\r\n\r\nYou can work around this by running `sudo chmod 0755 /usr/local/lib/node_modules/bin/{npm,npm-cli.js} /usr/local/lib/node_modules/bin/node-gyp-bin/node-gyp`, but I actually think you should figure out what happened during the install process and reinstall. I would not trust that installation of Node / npm."}}