{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/44203","labels_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44203/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44203/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44203/events","html_url":"https://github.com/Homebrew/homebrew/issues/44203","id":107450711,"number":44203,"title":"npm scripts can't run local install binaries","user":{"login":"TrevorSayre","id":421548,"avatar_url":"https://avatars.githubusercontent.com/u/421548?v=3","gravatar_id":"","url":"https://api.github.com/users/TrevorSayre","html_url":"https://github.com/TrevorSayre","followers_url":"https://api.github.com/users/TrevorSayre/followers","following_url":"https://api.github.com/users/TrevorSayre/following{/other_user}","gists_url":"https://api.github.com/users/TrevorSayre/gists{/gist_id}","starred_url":"https://api.github.com/users/TrevorSayre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrevorSayre/subscriptions","organizations_url":"https://api.github.com/users/TrevorSayre/orgs","repos_url":"https://api.github.com/users/TrevorSayre/repos","events_url":"https://api.github.com/users/TrevorSayre/events{/privacy}","received_events_url":"https://api.github.com/users/TrevorSayre/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Homebrew/homebrew/labels/upstream%20issue","name":"upstream issue","color":"ff7722"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-21T06:20:37Z","updated_at":"2015-09-21T11:04:51Z","closed_at":"2015-09-21T09:20:34Z","body":"```\r\ndevDependencies\": {\r\n    \"mkcjs\": \"^0.0.2\"\r\n  },\r\n  \"scripts\": {\r\n    \"build\": \"mkcjs\"\r\n  },\r\n```\r\n\r\nAbove is a snippet of an example package.json\r\n\r\nIf I do `npm install`, then mkcjs is installed successfully. If I then run `npm run build`, npm fails to run the local mkcjs binary which is in `node_modules/.bin/` as it is looking for node in `/usr/bin/node` when in reality node is located in `/usr/local/bin/node` thanks to Homebrew.\r\n\r\n```\r\n$ npm run build\r\n\r\n> project@ build /Users/user/project\r\n> mkcjs\r\n\r\nsh: /Users/user/project/node_modules/.bin/mkcjs: /usr/bin/node: bad interpreter: No such file or directory\r\n```\r\n\r\nOne work around is to `sudo ln -s /usr/local/bin/node /usr/bin/node` and then running `npm run build` works. However, this feels like a hack and requires sudo."},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments/141942741","html_url":"https://github.com/Homebrew/homebrew/issues/44203#issuecomment-141942741","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44203","id":141942741,"user":{"login":"TrevorSayre","id":421548,"avatar_url":"https://avatars.githubusercontent.com/u/421548?v=3","gravatar_id":"","url":"https://api.github.com/users/TrevorSayre","html_url":"https://github.com/TrevorSayre","followers_url":"https://api.github.com/users/TrevorSayre/followers","following_url":"https://api.github.com/users/TrevorSayre/following{/other_user}","gists_url":"https://api.github.com/users/TrevorSayre/gists{/gist_id}","starred_url":"https://api.github.com/users/TrevorSayre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrevorSayre/subscriptions","organizations_url":"https://api.github.com/users/TrevorSayre/orgs","repos_url":"https://api.github.com/users/TrevorSayre/repos","events_url":"https://api.github.com/users/TrevorSayre/events{/privacy}","received_events_url":"https://api.github.com/users/TrevorSayre/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T11:04:51Z","updated_at":"2015-09-21T11:04:51Z","body":"@xu-cheng Thank you for your help :+1: "}}