Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode keeps using wrong node version [duplicate]

I am running node.js version 18 using nvm on my Mac. node -v in the OSX terminal as well as in the VSCode terminal prints out the correct version (both zsh).

However, if I run node -v as a npm script through the VSCode menu (Terminal > Run Task > "node-version") it prints out an older version of node (v16 in this case).

I can't find any setting for this. Does anybody know where I can configure the currently wrong node version?

Thanks, Gerry

like image 280
Gerry Avatar asked Jun 05 '26 12:06

Gerry


1 Answers

I got it running. There were some old node bins under /usr/local/bin which were picked up by VSCode. After running

rm -rf /usr/local/bin/npm
rm -rf /usr/local/bin/node

and restart VSCode the node version is correct.

like image 96
Gerry Avatar answered Jun 07 '26 15:06

Gerry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!