2

I installed n using npm install -g n -f, and now when I run n 9 or n 8 or n 10 I always get the error:

$ n 9

  installing : node-v9.11.2

  Error: invalid version '9.11.2'

I don't understand why. These are valid versions.

When I run node -v I get:

v12.7.0

Any ideas why I might be getting this issue? It's really frustrating.

Simon
  • 2,498
  • 3
  • 34
  • 77

1 Answers1

1

You need to install any version of the node you want to use the following command to use the n module

n <version> to install a version of node. Example:

n 4.9.1 or

n 9.11.2 or

n 10 or

n latest or

n v8.11.3

After each installation, you will see a list of all the nodes available in the system with the n command prompt.

Finally, if the version of the node you want is available in the list provided, you can select and execute it with the ‍‍‍$ n 9 command.

mohammad javad ahmadi
  • 2,031
  • 1
  • 10
  • 27