安装express报错
安装express报错
npm install express --save
报错信息:
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "express" under a package
npm ERR! also called "express". 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\16273\AppData\Roaming\npm-cache\_logs\2021-08-23T02_52_46_049Z-debug.log
看了很多解决方法
尝试用管理员身份运行cmd 全局安装 在npm install 没作用
最终发现是命名冲突了
package.json里有个name 命名 与 express相同 导致安装失败;
修改为node-express后安装成功
ps: 因为我这里是做demo择机学习用的,命名都是默认,所以正正常公司项目不会遇到这些问题
还没有评论,来说两句吧...