我使用的是 npm v5.3.0.现在我想将 npm 更新到 v5.4.1.为此,我在终端中键入以下内容:
I am using npm v5.3.0. Now I want to update npm to v5.4.1.To do this I type the following in my terminal:
npm install -g npm
没有任何错误.但是当我输入 npm -v 时,我得到的版本是 5.3.0 而不是 5.4.1
without any errors.However when I type npm -v the version I get is the 5.3.0 not the 5.4.1
不得不提的是,我已经将 npm 前缀更改为另一个目录.有任何想法吗?我使用 Ubuntu 17.04
I have to mention that I have changed the npm prefix to another directory. Any ideas? I use Ubuntu 17.04
这是我的控制台输出:
推荐答案问题是我在 ~/.profile 中设置了 PATH 变量错误.为了帮助您理解.我已将 npm 前缀更改为 ~/.npm-global
The problem was that I has set the PATH variable in my ~/.profile wrong. To help you understand.I had changed npm prefix to ~/.npm-global
但是我将路径设置为 ~/npm-global.所以我将 ~/.profile 中的 PATH 变量固定为指向 ~/.npm-global.
However I set path to ~/npm-global.So I fixed the PATH variable in my ~/.profile to point to ~/.npm-global instead.
更多推荐
npm install npm
发布评论