npm WARN install Refusing to install vue-router as a dependency of itself

npm WARN install Refusing to install vue-router as a dependency of itself

 

今天在使用npm安装插件的时候提示如下错误:

npm WARN install Refusing to install vue-router as a dependency of itself

npm 阻止安装插件。

将npm的镜像改成taobao的镜像后测试还是不行,修改npm镜像:

1
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org 

  

后来发现是因为package.json里面的name名字和插件的名字同名,导致npm阻止插件安装。

安装vue  npm 安装(国内可以用淘宝的cnpm)

http://cn.vuejs.org/v2/guide/installation.html

原文:  http://www.cnblogs.com/ayseeing/p/4914438.html#undefined

原文地址:https://www.cnblogs.com/qingqingzou-143/p/6695115.html