{"_id":"run-node","_rev":"13-cfc974186dcd73a455d9cf5f30404ffa","name":"run-node","dist-tags":{"latest":"3.0.0"},"versions":{"0.1.0":{"name":"run-node","version":"0.1.0","keywords":["run","node","nodejs","node.js","find","binary","bin","execute","which","detect","path","env","bash","shell","sh"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"run-node@0.1.0","maintainers":[{"url":"github.com/mafredri","name":"Mathias Fredriksson"}],"homepage":"https://github.com/sindresorhus/run-node#readme","bugs":{"url":"https://github.com/sindresorhus/run-node/issues"},"bin":{"run-node":"run-node"},"dist":{"shasum":"cd64e597e4374b37c547f6a549e53322f17afa61","tarball":"https://registry.npmjs.org/run-node/-/run-node-0.1.0.tgz","integrity":"sha512-XGByhe8QWPi0eYuxUFFSXrL3qj5lqKjOVpIJM1sOxLqoFG9wF7J2aZqSdXp3ZcLWUNtATs1+OQ2tifJM+v1ZGg==","signatures":[{"sig":"MEQCIDexwn1eZhBkk4+UWTa/zv9AAkudzko/r3t7SOuOrfGCAiA2acLUZBZWEyiSDe935HRZ8GBSE7+30jGp0WBqr2EHIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["run-node"],"_shasum":"cd64e597e4374b37c547f6a549e53322f17afa61","engines":{"node":">=4"},"gitHead":"d682fcab81c2a4f6582de2cc3f803349af4de8fd","scripts":{"test":"./run-node --version"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/run-node.git","type":"git"},"_npmVersion":"2.15.5","description":"Run the Node.js binary no matter what","directories":{},"_nodeVersion":"4.4.5","_npmOperationalInternal":{"tmp":"tmp/run-node-0.1.0.tgz_1468692044231_0.5862267650663853","host":"packages-12-west.internal.npmjs.com"}},"0.1.1":{"name":"run-node","version":"0.1.1","keywords":["run","node","nodejs","node.js","find","binary","bin","execute","which","detect","path","env","bash","shell","sh"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"run-node@0.1.1","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/run-node#readme","bugs":{"url":"https://github.com/sindresorhus/run-node/issues"},"bin":{"run-node":"run-node"},"dist":{"shasum":"182ee9acd9a3b7ac5e6cf7679d5c33a1360c7b6f","tarball":"https://registry.npmjs.org/run-node/-/run-node-0.1.1.tgz","integrity":"sha512-WdoWCm16/JZiz3hOYFLb8gK4AX7UpLj2vdeVTJibyn061a6Oi6TAPOyx1fIy/ljADFd2QPxGR5zBOQrJGJ4dzA==","signatures":[{"sig":"MEUCIGfn9svQAeDXXgkTyP2+2OXyvF5pfma4/BA1s23YO0mCAiEAzodBBeOfI9xs1ClSpsA5UkSyM7bisyQcwgmih47b7dc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["run-node"],"_shasum":"182ee9acd9a3b7ac5e6cf7679d5c33a1360c7b6f","engines":{"node":">=4"},"gitHead":"b3d50446c878cc9f9c3e40e27f58a11ea1d8ca14","scripts":{"test":"./run-node --version"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/run-node.git","type":"git"},"_npmVersion":"2.15.5","description":"Run the Node.js binary no matter what","directories":{},"_nodeVersion":"4.4.5","_npmOperationalInternal":{"tmp":"tmp/run-node-0.1.1.tgz_1468696774088_0.5987678836099803","host":"packages-12-west.internal.npmjs.com"}},"0.2.0":{"name":"run-node","version":"0.2.0","keywords":["run","node","nodejs","node.js","find","binary","bin","execute","which","detect","path","env","bash","shell","sh"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"run-node@0.2.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/run-node#readme","bugs":{"url":"https://github.com/sindresorhus/run-node/issues"},"bin":{"run-node":"run-node"},"dist":{"shasum":"b26e942e94205dedbe532cddf0fd1dbd56649af6","tarball":"https://registry.npmjs.org/run-node/-/run-node-0.2.0.tgz","integrity":"sha512-Zsnxrr+CMGfm7VFuCj96E8tOpFHTEuZS9EvlXcKapVr2RUvr+fxTMxNgK5fXi3TprSgWoxobtR/3TXZT4na/Ng==","signatures":[{"sig":"MEYCIQDKhuQtFfP89NGwvZ3GX1S8ujYbm8kaXOI0Yn7RRNIcYgIhAOKjRLdsfHz5HgTwQTc8EuXF8t/rR+xUmsYwd++Q9OZq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"files":["run-node"],"engines":{"node":">=4"},"gitHead":"d79edd9184505233ba884f295a9f8a5b5ed2411c","scripts":{"test":"./run-node --version"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/run-node.git","type":"git"},"_npmVersion":"5.6.0","description":"Run the Node.js binary no matter what","directories":{},"_nodeVersion":"8.9.4","_npmOperationalInternal":{"tmp":"tmp/run-node-0.2.0.tgz_1515894356497_0.38352520461194217","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"run-node","version":"1.0.0","keywords":["run","node","nodejs","node.js","find","binary","bin","execute","which","detect","path","env","bash","shell","sh"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"run-node@1.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/run-node#readme","bugs":{"url":"https://github.com/sindresorhus/run-node/issues"},"bin":{"run-node":"run-node"},"dist":{"shasum":"46b50b946a2aa2d4947ae1d886e9856fd9cabe5e","tarball":"https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz","fileCount":4,"integrity":"sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==","signatures":[{"sig":"MEYCIQCmvpXVsIS8LKpIspwdaw39p67LfXV0RImhPV+6txJBkwIhAKTKMM721QdKcFnI5iHrSBMgeOwG/j7P8ZjhPjXLe7K8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2OmnCRA9TVsSAnZWagAA27QP/RLMXnznAPtY0KhHe6sr\nLDps4mbdTY3eI+jQ0Us2T7cxwR37dWJTxf/Y6Wd2IAcSMQgp8bkEkl/1wN+v\nJ0mvOBM/NFJceLCzCK5Mbv6Ms9seemADHZb5mGrQxV2VkfLX9l2K/XmlamWi\nRJQDxWDij5gHt+0JkiNBD2aXebKFqWGhSD4YcmufWpk5oYizlapN0CXcft/1\nOfB1FXEDbuQe3IEpoAgzQTG3NzUFGMJR3M7/Fu9oN5Kh51T+itZDEgpRrkRa\nQCSFuzIsnZZ4bIdtq+UbJfdBgAZ9AcMuse2iP/TgmlYOcCRbvytMiVLaccrP\nU7RvvHvcRAGcNNcKnP/M73pcjJusjzqqbL42ZWd6IVJVVlWK8gWlknQu0lO7\nPLzyqQBazje2R6UKmW/PIrXgsyKrviCTlbk2SmqKyz1oN2C8xaGSgDyQ6/9C\n5p7kRglpKa3xt57zfU25mM0zEhgKyeJxupu6IKrx54UJRWbcKDqLpYSW3vY0\nGgCrQO2y/tRorG8EQIXuTs+8c/BRIg3QF91zJc+4ku3ySpjX8BU6xANu33nl\nN9ZROYg91U/UxmGnN2BvYNLKw2R+exoCsy7xhAWCZEe7xn5YM+WXwf6XENUZ\nZ3o1IO2zhjtnMpeb7/ObGVunmgVPR8ui55HC8uUj5yDMfoA/qCMPL/pfltNl\nvRZf\r\n=vMXk\r\n-----END PGP SIGNATURE-----\r\n"},"files":["run-node"],"engines":{"node":">=4"},"gitHead":"d14acdff68721e05c46d69d0a3ce213eaa32b3e4","scripts":{"test":"./run-node --version"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/run-node.git","type":"git"},"_npmVersion":"5.6.0","description":"Run the Node.js binary no matter what","directories":{},"_nodeVersion":"8.10.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/run-node_1.0.0_1524165030735_0.10501742839010042","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"run-node","version":"2.0.0","keywords":["run","node","nodejs","node.js","find","binary","bin","execute","which","detect","path","env","bash","shell","sh"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"run-node@2.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/run-node#readme","bugs":{"url":"https://github.com/sindresorhus/run-node/issues"},"bin":{"run-node":"run-node"},"dist":{"shasum":"0f598db2bf1cca3cc972abdb6f48c1f40cb29317","tarball":"https://registry.npmjs.org/run-node/-/run-node-2.0.0.tgz","fileCount":4,"integrity":"sha512-M024oSKOfXRbBZ4dzWeS4mZfLlkVrLbR+02lSno344whh60hFN7qjWnf3QXm/JePD9CR7W4gRe9tt4H/2PGkcw==","signatures":[{"sig":"MEUCIBFT4RdhGEZD6oUm3KqOJrc/Iw58h8DmKbffVnqArEsHAiEA3++LLSqEP4wRGOLO/p1dJEW/GVgTW6Wu9CzKue2Pxuw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeURVSCRA9TVsSAnZWagAAyhAP/0WccIbSsRYe7IEfj2D7\nG2Vfc2aDnYXRBRIOI1adg+vgTPDg3Zg/wT/cY7iDZrjwygpb/CzxcWJv1CmO\nsP8+juNVZw01Yv15wGzU9N4vPFzb+GlK6szJ93KOmcmQ63iYq3o3D0CvAUlT\nAwqDRF+uUQ4aF5zTejBDiEkNaeISkInDiWm10wmFtcGgBQhrio/X6XbSqWDf\nMIZ6Y52T03SxLa8muW0Ny6JRYhnkIIviE+iCIQe44zjnI7NX2yr9FJD84dvu\nzdvpfGoHB5/TF5ejX18yCa3Y6yZQpKiA8hbEVKLGBgg6rVs9t2ZJln8yLVCO\nieTo1Z9+zl7LrUsJZAc/1Tcc8p8pH+yhXqL6bxvbumBPMMWFptBcL1kFPwqc\nqSyHzZio3bJzY4f1DbQoiK9Vi66eF3BH2WLlKJvKjcsOfib4pZgquLzgde/0\nnuqGmlwULRsC05o1Rtoic+pQN5EX5HmsN6si3LP1ROjC2wux3tUXshU3srOY\nvCYh69V21s1yOK0f7xZRg2CG9zmmLneYUbE2M9DZqKcDkPwxXPLaDpSunk+D\nAG9AO2csOJr3ug7Qwcs2gpRXMN0CcJUoTRI1QnNqcRif+22mHFYwJ74D63ZP\n4IoRV9g1rGxafsrdMok1yEXCPypucuXmuh/8MNc5+byV4JJmq8zb47mjIC/T\nlltz\r\n=xdPJ\r\n-----END PGP SIGNATURE-----\r\n"},"engines":{"node":">=10"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"aadc87252498dac5a4187ab4a038e22000fd031a","scripts":{"test":"./run-node --version"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/run-node.git","type":"git"},"_npmVersion":"6.13.4","description":"Run the Node.js binary no matter what","directories":{},"_nodeVersion":"10.18.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/run-node_2.0.0_1582372178089_0.47433207003914113","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"run-node","version":"3.0.0","description":"Run the Node.js binary no matter what","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/run-node.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","bin":{"run-node":"run-node","run-npx":"run-npx"},"engines":{"node":">=18"},"scripts":{"test":"./run-node --version"},"keywords":["run","node","nodejs","node.js","npx","npm","find","binary","bin","execute","which","detect","path","env","bash","shell","sh"],"_id":"run-node@3.0.0","gitHead":"8489f3b0fbfd6b4fcc1afda840625e12c12b896b","bugs":{"url":"https://github.com/sindresorhus/run-node/issues"},"homepage":"https://github.com/sindresorhus/run-node#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-MIO6fytrohsYGY5qzrTmI6Leh3Bh98jwWMabpZJTejbw68uJn+3QgqN0g4xQgrbn5216VrgyQiDGI6EXVwfwrw==","shasum":"2dc62dd481311d9b06d9dba6d4186f51a98f1525","tarball":"https://registry.npmjs.org/run-node/-/run-node-3.0.0.tgz","fileCount":5,"unpackedSize":7455,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEDeV7KjllFkOBmZmgqMvUUUHNfGTQOPUVSSnBmWpbtqAiBxFhtZxOkvaAIqB4habFY3fduwkczhncCiLLj//bTHIA=="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-node_3.0.0_1757966134048_0.05380486343978763"},"_hasShrinkwrap":false}},"time":{"created":"2016-07-16T18:00:46.331Z","modified":"2025-09-15T19:55:34.408Z","0.1.0":"2016-07-16T18:00:46.331Z","0.1.1":"2016-07-16T19:19:36.531Z","0.2.0":"2018-01-14T01:45:56.617Z","1.0.0":"2018-04-19T19:10:30.886Z","2.0.0":"2020-02-22T11:49:38.277Z","3.0.0":"2025-09-15T19:55:34.235Z"},"bugs":{"url":"https://github.com/sindresorhus/run-node/issues"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/run-node#readme","keywords":["run","node","nodejs","node.js","npx","npm","find","binary","bin","execute","which","detect","path","env","bash","shell","sh"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/run-node.git"},"description":"Run the Node.js binary no matter what","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"readme":"# run-node\n\n> Run the Node.js binary no matter what\n\nYou can't always assume running `$ node file.js` will just work. The user might have the `node` binary in a non-standard location. They might be using a Node.js version manager like `nvm`, which is sourced in a subshell and not available from the outside. Or they might have `node` installed as a local dependency in an npm project. It also depends from where you're trying to run it. For example, GUI apps on macOS doesn't inherit the [`$PATH`](https://en.wikipedia.org/wiki/PATH_(variable)), so the `node` binary would not be found. Most projects that depend on Node.js just end up telling the user to manually set the full path to the `node` binary in some project specific settings. Now every project has to do this. [Ugh...](https://gist.github.com/cookrn/4015437) I prefer things to *just* work. With this module it will.\n\nThis Bash script uses some tricks to find the Node.js binary on your system and run it. A companion `run-npx` script is also provided to reliably run `npx`.\n\nCan be used from any environment that can spawn a process (Shell, Python, Ruby, Swift, Objective-C, etc).\n\n### npm\n\n#### Install\n\n```sh\nnpm install run-node\n```\n\n#### Usage\n\n```sh\n./node_modules/.bin/run-node file.js\n```\n\nOr in an [npm run script](https://docs.npmjs.com/cli/run-script):\n\n```json\n{\n\t\"start\": \"run-node file.js\"\n}\n```\n\nTo run `npx` commands:\n\n```sh\n./node_modules/.bin/run-npx package-name\n```\n\nWhen run within an npm script context, `run-node` will use the same Node.js binary that npm is using (via the `npm_node_execpath` environment variable), ensuring consistency with the parent process. When run directly outside of npm scripts, if the [`node`](https://www.npmjs.com/package/node) package is found in the local `node_modules` directory, that binary will be used instead.\n\n### Manually\n\n#### Install\n\nDownload the [run-node](run-node) file:\n\n```sh\ncurl -sSLO https://github.com/sindresorhus/run-node/raw/main/run-node && chmod +x run-node\n```\n\nFor `npx` support, also download [run-npx](run-npx):\n\n```sh\ncurl -sSLO https://github.com/sindresorhus/run-node/raw/main/run-npx && chmod +x run-npx\n```\n\n#### Usage\n\n```sh\n./run-node file.js\n```\n\nOr with `npx`:\n\n```sh\n./run-npx package-name\n```\n\n#### Customizable cache path and error message\n\nThe cache path and error message are defined by the `RUN_NODE_CACHE_PATH` and `RUN_NODE_ERROR_MSG` environment variables. You could use them in a script or add them to your `~.bashrc`.\n\nDefault config:\n\n```sh\nexport RUN_NODE_ERROR_MSG=\"Couldn't find the Node.js binary. Ensure you have Node.js installed. Open an issue on https://github.com/sindresorhus/run-node\"\nexport RUN_NODE_CACHE_PATH=\"/home/username/.node_path\"\n```\n\nIf the `RUN_NODE_CACHE_PATH` environment variable is defined explicitly, the script it points to will be sourced before looking for a `node` binary. You can use this script to override your `PATH` variable so that a specific `node` binary is found.\n","readmeFilename":"readme.md","users":{"flumpus-dev":true}}