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 start
which in term will downloadnpm
and put it in.node
subfolder of the project. Then,make
uses thenpm
executable that was downloaded, to run allnpm
scripts. What I achieve, is a user should not worry about if they havenpm
installed locally and what version it is. I knownvm
somehow "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