项目中遇到的错误
liuboyideMacBook-Pro:vue-resource liuboyi$ npm install --save vue-resource
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name “vue-resource” under a package
npm ERR! also called “vue-resource”. 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! /Users/liuboyi/.npm/_logs/2019-09-25T01_12_05_935Z-debug.log
liuboyideMacBook-Pro:vue-resource liuboyi$
原因是因为我的文件名名字 也叫vue-resource跟需要下载的vue-resource冲突了 所以报错
解决方法
检查package.json下的name字段是不是项目名字和你安装的那个包名字相同了,如果一样就会报那个错,把项目名字改成和你安装不冲突的名字
来源:https://blog.csdn.net/weixin_43945841/article/details/101346542