Issue: We need to run and use two different node versions i.e 14, 12 simultaneously on two different applications to support the use of npm run dev, npm install commands with defined version accordingly.
Steps we have tried so far:
.nvmrc file on each application defining the version. This will allow nvm to use the version defined on file i.e nvm use && npm run dev.nvm exec command on git bash window.However, the nvm-windows don't support the exec command and the .nvmrc file (https://github.com/coreybutler/nvm-windows/issues/169). Is there any way to run two different versions of the node simultaneously?
OS: Windows
NVM still doesn't support this, but Volta does.Kritarth's answer about the nvm-session CLI tool led me to Volta. nvm-session has been abandoned in favor of Volta, which also supports multiple Node versions working simultaneously on Windows.
You can find the binary path to the npm and node when you are on specific node version, by typing:
which node
which npm
and then run the node from its binary path like so (in my pc):
/home/sina/.nvm/versions/node/v14.17.3/bin/node index.js #first project
/home/sina/.nvm/versions/node/v12.22.3/bin/node index.js #second project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With