美文网首页
创建项目的时候package.json的name不能跟npm包的

创建项目的时候package.json的name不能跟npm包的

作者: 且试天下Always | 来源:发表于2019-04-26 14:22 被阅读0次

有时候我们想测试 vue-router,文件夹名字命名为 vue-router,然后直接 npm init 会创建 package.json 文件,此时package.json 文件的 name 就是 "vue-router",

此时我们用 npm install --save vue-router 安装 vue-router 就会报错

npm ERR! code ENOSELF

npm ERR! Refusing to install package with name "vue-router" under a package

npm ERR! also called "vue-router". Did you name your project the same

npm ERR! as the dependency you're installing?

npm ERR!

npm ERR! For more information, see:

npm ERR!    <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>

npm ERR! A complete log of this run can be found in:

npm ERR!    C:\Users\mhq\AppData\Roaming\npm-cache\_logs\2019-04-26T06_15_19_822Z-debug.log

相关文章

网友评论

      本文标题:创建项目的时候package.json的name不能跟npm包的

      本文链接:https://www.haomeiwen.com/subject/opwfnqtx.html