13

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?

Patrick Hund
  • 19,163
  • 11
  • 66
  • 95

1 Answers1

30

You can use the command nvm alias to set the default version you would like to use, for example:

nvm install 10.17.0
nvm alias default 10.17.0
Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Patrick Hund
  • 19,163
  • 11
  • 66
  • 95