Last 12 weeks · 0 commits
4 of 6 standards met
https://github.com/sindresorhus/run-node/blob/master/run-node#L4 Due to the combination of this line and the hoisting done on installs, any dep in your tree which installs will result in all calls via to use it, even if the top level project did not intend this behavior. The only workaround I can see without changes to this lib is to also install of your own version at the top level of each project. I think that parsing json in bash to determine if it is a top level dep is a hard problem best avoided, but IMO this bug makes this module actively harmful in the contexts which I have seen it used. One idea I had, which would resolve it in the use case I encountered this, is to use if it exists as the first check. This would at least ensure that if it was run in the context of a package.json script with it would use the same node version found in the parent process. I am happy to open this PR if this seems like a good resolution to the problem above.
Repository: sindresorhus/run-node. Description: Run the Node.js binary no matter what Stars: 142, Forks: 11. Primary language: Shell. Languages: Shell (100%). License: MIT. Latest release: v3.0.0 (5mo ago). Open PRs: 0, open issues: 0. Last activity: 5mo ago. Community health: 85%. Top contributors: sindresorhus, mearns, mafredri, nmssilva, Richienb, nocoolnametom.
caches the path with nvm version of Node.js that set as default when first runs. Right now ignores a stale only when is not found, but there are other cases to consider: 1. A new version of Node.js was installed and set as default via nvm. will continue to run the old version because the path in is not updated. 2. A new version of Node.js was installed and set as default via nvm, and the old version is deleted. will not run the new version, and will run found further in the path (like one installed via Homebrew).