When running npm run dev I'd like to have npm use a specific version of Node. In other words, I'd like to configure this script to use a specific Node path.
To make things even more complicated the npm run dev actually invokes Angular's ng CLI. So it's important this works too with the respective Node executable.
I tried setting NODE_PATH env var before ng serve, as well as looking for some conduit to put in .npmrc, but couldn't figure out a way to achieve what I am looking for.
make startwhich in term will downloadnpmand put it in.nodesubfolder of the project. Then,makeuses thenpmexecutable that was downloaded, to run allnpmscripts. What I achieve, is a user should not worry about if they havenpminstalled locally and what version it is. I knownvmsomehow "solves" this, but I don't like it too much.my-node ./node_modules/@angular/cli/bin/ng.js. This doesn't guarantee that the same "node" will be used through the process, but there's a chance it will work. nvm can affect "node" system-wide, that's its purpose, which this may be undesirable for a user. This is basically a case for containers