javascript - npm安装任何模块都报错,安装失败是为什么?

查看:276
本文介绍了javascript - npm安装任何模块都报错,安装失败是为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

devusers ❯❯❯ sudo npm install -g vue-cli
Password:
npm ERR! registry error parsing json
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "vue-cli"
npm ERR! node v5.4.1
npm ERR! npm v3.3.12

npm ERR! Unexpected token <
npm ERR! <html>
npm ERR! <head><title>403 Forbidden</title></head>
npm ERR! <body bgcolor="white">
npm ERR! <center><h1>403 Forbidden</h1></center>
npm ERR!


<center>JuanniuX/15.12.29</center>
npm ERR! </body>
npm ERR! </html>
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/is...

npm ERR! Please include the following file with any support request:
npm ERR! /Users/devusers/npm-debug.log

解决方案

提示你访问源出错了。检测一下:

  1. 是否网络dns被劫持

  2. 是否npm版本过旧

  3. 是否编辑写入了无效的源

这篇关于javascript - npm安装任何模块都报错,安装失败是为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆