安装mongoose依赖时发生了错误

npm ERR! code ENOSELF
npm ERR! Refusing to install package with name “mongoose” under a package
npm ERR! also called “mongoose”. 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\Administrator\AppData\Roaming\npm-cache_logs\2019-06-13T02_07_16_781Z-debug.log

  • 今天安装mongoose依赖时发生了一个比较低级的错误,项目名(安装的目录名)与依赖的名称相同导致安装失败。所以项目起名时,要注意不要与任何依赖名相同。
  • 解决方法:在package.json中改变项目名称

你可能感兴趣的:(错误与处理)