NVM - Node Version Manager
Each sandbox includes NVM so you can easily change your node version for each project.
Each sandbox includes NVM so you can easily change your node version for each project.
Here is a simple example from NVM documentation:
$ nvm use 16
Now using node v16.9.1 (npm v7.21.1)
$ node -v
v16.9.1
$ nvm use 14
Now using node v14.18.0 (npm v6.14.15)
$ node -v
v14.18.0
Remember that the more node versions you install, the more space it takes up. If you don't need a version anymore, you can uninstall it with nvm uninstall <version>
.
Known issue
Sometimes, after you exit the sandbox, and come back, your node version will no longer be here.
We have not identified yet why the issue happens only some time
For example, you will have an error such as
npm: command not found
To resolve this issue, manually re-select your Node.js version using nvm
.
Additionally, you can set a default version of Node.js to ensure it is automatically selected in new terminal sessions.
Run the following command to set your default Node.js version:
nvm alias default node
This command tells nvm
to automatically use the latest installed version of Node.js as the default
After setting the default, close your terminal session and reopen it. The issue should be resolved, and Node.js should be automatically available.
Last updated