Closed MikeTheCanuck closed 6 years ago
D'oh! Sorry, I didn't spot #1647 and #1652 until after filing this and continuing to dig around the interwebs. Feel free to close this as a duplicate of those.
Sounds good :-)
I fixed this temporarily by adding nvm use node
to the end of my .bash_profile after the nvm path export.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm use node
c
@danieldbird you shouldn't need that if you do nvm alias default node
once in the terminal.
@ljharb only to get around the
nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
Run
npm config delete prefixor
nvm use --delete-prefix v9.6.1 --silentto unset it.
error in VSCode and Atom. It works fine in the native terminal, or iTerm, and throws no error message.
This seems to be happening because no version of node is being used when first opening the integrated terminal in VSCode or Atom.
Edit: Even after running nvm alias default node
@danieldbird can either VSCode or Atom be made to use a login shell?
@ljharb I saw another discussion you were a part of that helped me. It appears I have fixed the issue. What I did was ensure the following were uninstalled brew uninstall node
, brew uninstall npm
, brew uninstall nvm
, then I ensured the hidden home directories were removed .npm
, .nvm
, then i used the nvm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
install command. And then I installed node using the OS installer. All is working fine now in both VSCode, Atom, and native terminals, Terminal and iTerm. Thanks.
i have the same problem ,
nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local/Cellar/node@6/6.12.3"
Run npm config delete prefix
or nvm use --delete-prefix v8.9.4 --silent
to unset it.
it worked after i delete the folder: rm -rf /usr/local/Cellar/node@6
That fix doesn't seem to resolve it for me.
As a workaround, I've redirected the output to /dev/null
and called nvm use node
in my ~/.bashrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 2>/dev/null
$(nvm use node) 2>/dev/null
@ThibaudCrespin this solved my problem. cheers
@ThibaudCrespin Great! Best!
@ThibaudCrespin it works well! thanks!
i have the same problem,
rm -R /usr/local/lib/node_modules/npm
rm -R /usr/local/bin/npm /usr/local/lib/node_modules/npm/bin/npm-cli.js
this resolve my problem, because I install node use brew install node
brefore.
you need uninstall node and npm when use nvm.
Tried lots of these things, but the only thing that worked for me was installing node/npm via the installer from nodejs.org then adding export PATH=$PATH:/usr/local/git/bin
in my ~/.bash_profile
Hope this helps someone.
brew uninstall --ignore-dependencies node
(igonore-deps
because I had yarn
installed) worked for me. What @webkong said was accurate. At the end of the day, if you have nvm
installed then there's no need for a "global" node/npm install. Remove them (however you installed them determines how that gets done) and you're good.
1) brew uninstall node
3) reinstall nvm
`curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash`
Thanks @Guang1234567, it helps
@greentornado
glad works for you, haha.
@ThibaudCrespin Finally the solution that works for me. Thank you very much!
$ brew uninstall --ignore-dependencies node
- reinstall nvm
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.37.2/install.sh | bash
This was the solution for me, thanks!
Just had this issue myself. Got around it by switching to the right node version for my project in the terminal (in my case nvm use 10), THEN opening VS Code from that terminal window. From there when I open a debugging window in VS Code, it has the right node version set.
This bug annoyed me for weeks, if not months, even in 2024. Finally, I was able to get rid of it (with some help from this thread).
In my case, the following sequence worked:
And just like that, opening the Javascript Debug Terminal on VSCode no longer annoyed me with the nvm is not compatible with the npm config "prefix" option
bug! 😃
IT WAS INSANELY SATISFYING! 😮💨
i have the same problem,
rm -R /usr/local/lib/node_modules/npm
rm -R /usr/local/bin/npm /usr/local/lib/node_modules/npm/bin/npm-cli.js
this resolve my problem, because I install node usebrew install node
brefore. you need uninstall node and npm when use nvm.
thank you,this solved my problem,I used homebew to install node before
Hi folks, in my latest nvm configuration I am now seeing the
nvm is not compatible with the npm config "prefix" option
error when opening the VS Code Terminal. (Opening abash
session using Terminal.app doesn't show any warnings or errors.)I skimmed #855 and didn't find an obvious solution - that issue made this error sound like an unfortunate bug in
nvm.sh
so I was hoping there'd be a permanent solution that didn't require us to run another command every time a shell is opened.nvm debug
output:nvm ls
output:nvm
? (e.g. install script in readme, homebrew): I thought it was Homebrew, but runningbrew uninstall nvm
results in "Error: No such keg: /usr/local/Cellar/nvm" so it must have been thecurl
approachnvm alias default lts/*
.bashrc
,.bash_profile
,.zshrc
, etc) that modifies thePATH
? My.profile
includes this: