0

I am trying t update my Node version globally. I have Node v17.8.0 in my local machine, but when I check the node version that I am in VS code; it is still using v14.9.0.

I have tried to re-start, but it is still not changing. What should I do to update the node version to the latest version in VS code? I am a mac user.

dhilt
  • 18,707
  • 8
  • 70
  • 85
Active Coder
  • 73
  • 1
  • 2
  • 8
  • How did you install/update Node.js. What do you mean with _"the Node.js verions in VS code"_? How do you use Node.js in VS Code? How is this realted to XCode? – jabaa Mar 27 '22 at 00:42

2 Answers2

0

Make sure you are using Node v17.8.0 (which is different from having it just downloaded). Run: node -v it should output something like v17.8.0. If not, then you need to configure your computer to use the new version (I recommend using nvm to manage your node versions.

It is also possible that you defined runtimeVersion: 14.9.0 at your launch.json. You might want to 1) remove that, or 2) set it to 17.8.0.

Gluey1017
  • 36
  • 2
  • Somehow I guess NVM is the problem. It's already tagged in the question. AFAIK NVM requires settings in .bashrc or .zshrc, but many tools don't evaluate these scripts. It's simpler with [`n`](https://www.npmjs.com/package/n). – jabaa Mar 27 '22 at 01:03
0

In my case, I was able to solve this problem by setting a new default version of nodejs via nvm:

nvm alias default 18

After that when I restart VS Code it starts using node v18.

dhilt
  • 18,707
  • 8
  • 70
  • 85