使用 NVM 时找不到 NPM [英] NPM not found when using NVM
本文介绍了使用 NVM 时找不到 NPM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用 nvm 文档安装了 node/npm.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh |猛击
那么:
nvm 安装节点
此时节点正在工作,但 npm 命令结果为:
npm: 命令未找到
如何让 npm 正常工作?
解决方案
我发现这与之前版本的 npm 存在冲突,尽管使用了 apt-get remove node
.
我通过从头开始重新安装 npm 解决了这个问题:
rm -R ~/.npm ~/.nvmcurl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh |猛击nvm 安装节点
我在此处找到了解决方案.>
I have installed node/npm using the nvm documentation.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
Then:
nvm install node
At this point node is working but the npm command result with:
npm: command not found
How can I have npm to work correctly ?
解决方案
I found out that this was a conflict with a previous versions of npm that have not been removed properly despite a apt-get remove node
.
I solved it by reinstalling npm from scratch:
rm -R ~/.npm ~/.nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
nvm install node
I found the solution here.
这篇关于使用 NVM 时找不到 NPM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文