{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/12126","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/12126/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/12126/comments","events_url":"https://api.github.com/repos/npm/npm/issues/12126/events","html_url":"https://github.com/npm/npm/issues/12126","id":144240243,"number":12126,"title":"Add \"npm exec\" CLI command to run programs under ./node_modules/.bin","user":{"login":"gajus","id":973543,"avatar_url":"https://avatars.githubusercontent.com/u/973543?v=3","gravatar_id":"","url":"https://api.github.com/users/gajus","html_url":"https://github.com/gajus","followers_url":"https://api.github.com/users/gajus/followers","following_url":"https://api.github.com/users/gajus/following{/other_user}","gists_url":"https://api.github.com/users/gajus/gists{/gist_id}","starred_url":"https://api.github.com/users/gajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gajus/subscriptions","organizations_url":"https://api.github.com/users/gajus/orgs","repos_url":"https://api.github.com/users/gajus/repos","events_url":"https://api.github.com/users/gajus/events{/privacy}","received_events_url":"https://api.github.com/users/gajus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-29T11:56:07Z","updated_at":"2016-03-29T12:05:16Z","closed_at":null,"body":"Certain deployment scripts require running programs that have been installed as devDependencies, e.g. my deployment script involves running webpack program:\r\n\r\n```sh\r\nnvm use v5.8.0;\r\nnpm set progress=false;\r\n(cd ./src/client; npm install; NODE_ENV=production node ./node_modules/.bin/webpack --config ./webpack.config.production.js);\r\n(cd ./src/api; npm install);\r\n(cd ./src/bin; npm install);\r\npm2 delete ecosystem.json;\r\npm2 start ecosystem.json --env production;\r\n```\r\n\r\nBecause webpack is installed as a devDependency, it is only available under `node ./node_modules/.bin/webpack`. The downside of this approach is that it is not cross-platform safe and the path depends on the npm version (i.e. it might change in the future versions).\r\n\r\nTherefore, it would be nice to have `npm exec <alias name>` command, which would be equivalent to running `node ./node_modules/.bin/<alias name>`."},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/202858066","html_url":"https://github.com/npm/npm/issues/12126#issuecomment-202858066","issue_url":"https://api.github.com/repos/npm/npm/issues/12126","id":202858066,"user":{"login":"gajus","id":973543,"avatar_url":"https://avatars.githubusercontent.com/u/973543?v=3","gravatar_id":"","url":"https://api.github.com/users/gajus","html_url":"https://github.com/gajus","followers_url":"https://api.github.com/users/gajus/followers","following_url":"https://api.github.com/users/gajus/following{/other_user}","gists_url":"https://api.github.com/users/gajus/gists{/gist_id}","starred_url":"https://api.github.com/users/gajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gajus/subscriptions","organizations_url":"https://api.github.com/users/gajus/orgs","repos_url":"https://api.github.com/users/gajus/repos","events_url":"https://api.github.com/users/gajus/events{/privacy}","received_events_url":"https://api.github.com/users/gajus/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T12:05:16Z","updated_at":"2016-03-29T12:05:16Z","body":"This can be improved using `$(npm bin)/webpack`."}}