npm 更新成功,但仍显示旧版本 [英] Npm updates sucessfully, but still shows old version
问题描述
当我执行 npm -v
时,我发现我仍然使用 5.6.0.并不断收到执行 npm i npm
的提示.
When I do a npm -v
I see that I am still on 5.6.0. And keep getting prompts to do a npm i npm
.
但我已经做了一个 sudo npm install npm@latest -g
并用 npm outdated -g --depth=0
仔细检查以查看我的全局npm 已经是最新的 (6.0.0).
But I've done a sudo npm install npm@latest -g
and double checked with a npm outdated -g --depth=0
to see that my global npm is at the latest already (6.0.0).
我该如何解决这个冲突?我使用的 npm 是最新的还是旧的?是因为我的全局链接不正确还是什么?
How do I resolve this conflict? Is the npm I'm using the latest or is it still the old one? Is it because my global is linked incorrectly or something?
推荐答案
尝试关闭终端 - 一旦你再次打开它应该可以工作,对我来说效果很好.
*IvanD 在对原帖的评论中写了这个解决方案,我认为值得一个回复帖.
*IvanD wrote this solution in a comment to the original post, I thought it's worth an answer post.
这篇关于npm 更新成功,但仍显示旧版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!