mac电脑下用nvm安装了多个node版本,打开vscode终端后,经常提示如下错误信息:
nvm is not compatible with the npm config “prefix” option: currently set to “/usr/local”
Run npm config delete prefix
or nvm use --delete-prefix v6.12.3 --silent
to unset it.
或者vscode终端下无法识别node -v或npm -v, 也就是说虽然你安装了多个版本的node, 但vscode的终端就是找不到node的路径。
后来搜索找到如下vscode的设置,添加后重启vscode, 问题解决。
"terminal.integrated.shellArgs.osx": []
原文链接:https://pangjunpeng.com/2018/12/17/%E8%A7%A3%E5%86%B3vscode%E4%B8%8B%E9%BB%98%E8%AE%A4node%E7%89%88%E6%9C%AC%E4%B8%8D%E5%AF%B9%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BB%A5%E5%8F%8A%E4%BD%BF%E7%94%A8avn%E8%AE%BE%E7%BD%AE%E6%9F%90%E4%B8%AA%E9%A1%B9%E7%9B%AE%E9%BB%98%E8%AE%A4node%E7%89%88%E6%9C%AC/