I'm using nvm to manage my Node.js versions. In my projects, I have .nvmrc files in the project root. When I run nvm use
, I get the Node.js version needed for the project.
This is all working great, but when I open up a new console window, at first I always have a very old Node.js version set automatically.
Running node -v
gives me 6.9.5
.
What's really annoying is that my IDE (IntelliJ IDEA) runs pre-commit hooks when I use its VCS commit dialog using this old Node.js version, which makes unit tests and the commit fail.
How can I make it so that a specific version of Node.js is set as default?