Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode nvm complaining about a prefix option when the Integrated Terminal is launched

nvm (Node Version Manager) users often see this error for the first time inside VS Code's Integrated Terminal:

nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
Run `nvm use --delete-prefix v8.12.0 --silent` to unset it

According to the solution here: https://github.com/Microsoft/vscode-docs/blob/master/docs/editor/integrated-terminal.md#why-is-nvm-complaining-about-a-prefix-option-when-the-integrated-terminal-is-launched

I have to find the old npm install path first then run "which npm" before it.

But where is the nvm initialization script and how to run "which npm" before it, just add line at the beginning of the script? Is there any other way to fix the problem?

like image 390
user3153765 Avatar asked Feb 07 '19 09:02

user3153765


2 Answers

run this

$ npm config delete prefix 
$ npm config set prefix $NVM_DIR/versions/node/v8.12.0

solution is from nvm is not compatible with the npm config "prefix" option:

like image 103
Alongkorn Avatar answered Sep 28 '22 01:09

Alongkorn


Setting debug.node.autoAttach to disabled worked for me

like image 45
Željko Šević Avatar answered Sep 28 '22 02:09

Željko Šević