npm,node更新最新版本

1、错误场景:安装vue插件的时候,报错,提示安装最新版本


npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator.CE-20151109NQJC\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v10.15.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! muse-ui@3.0.2 dev: `NODE_ENV=normal parcel demo/index.html`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the muse-ui@3.0.2 dev script 'NODE_ENV=normal parcel demo/index.html'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the muse-ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=normal parcel demo/index.html
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs muse-ui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls muse-ui
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\frame\vue\muse-ui-master\npm-debug.log

2、查看版本

npm -v

3、安装最新版本(全局)

npm install -g npm

4、安装指定版本(@后面跟版本号)

npm -g install npm@6.9.0

5、node版本升级

官网下载最新安装包,安装覆盖

6、安装另外一个包的时候,还是有报错,

C:\Users\Administrator.CE-20151109NQJC\AppData\Roaming\npm
npm WARN deprecated autoprefixer-loader@3.2.0: Please use postcss-loader instead of autoprefixer-loader
npm WARN deprecated babel-preset-es2015@6.24.1: �  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 
npm ERR! Unexpected end of JSON input while parsing near '...ata-0.0.10.tgz"}},"0.'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator.CE-20151109NQJC\AppData\Roaming\npm-cache\_logs\2019-04-01T09_59_14_849Z-debug.log

错误原因分析

使用命令npm install xx安装包的时候,默认是从npm的镜像源服务器进行下载的,该服务器是放在国外,很容易安装失败,因此全局安装nrm镜像源管理器,nrm里面存放了多个镜像源服务器

npm isntall nrm -g

问题解决:

先清空缓存,再重新安装

npm cache clearn --force

npm install

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

五月呀

谢谢请喝奶茶~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值