Vithia An
Vithia An

Reputation: 31

Checking version of node on macOS

I wanted to check the version of node js on my machine. It gives two different numbers:

/usr/local/n/versions/node$ ls
14.16.1

/usr/local/n/versions/node$ node -v
v8.9.4

Are there two different versions?

Upvotes: 3

Views: 15351

Answers (1)

Đăng Khoa Đinh
Đăng Khoa Đinh

Reputation: 5411

We can have different nodejs versions on the same machine, but there is only 1 active version for a user at the same time.

Your command node -v give you the NodeJS active version, which is v8.9.4. The ls command give you only the content of the folder. NodeJS v14.16.1 is installed on your machine, but is not active.

Upvotes: 1

Related Questions