I would like to have automatically invoke \"nvm use\" when I run \"npm start\". So I come up with this solution:
package.json
\"scripts\": {
\"presta
Your package.json could look like
"scripts": {
"start": "source /whereever/located/nvm.sh; nvm use; nodemon index.js"
}
To explain. The "start" line is a single shell instance. So you have to have nvm initialize the PATH in that shell instance. Also, nvm
is a shell function not an executable shell script. The nvm function lives in the shell instance, and is created by sourcing the nvm.sh file.
Sorry for the edits cuz I didn't test my first two.