npm install npm

编程入门 行业动态 更新时间:2024-10-27 22:34:03
本文介绍了npm install npm -g 不会将 npm 更新到最新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用的是 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

本文发布于:2023-06-08 14:28:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/583073.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:npm   install

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!