有时候我们想测试 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