安装角度通知图标时,npm ERR代码ENOSELF

时间:2019-12-06 19:46:15

标签: angularjs npm

我正在尝试使用此链接作为构建通知系统的参考:

https://github.com/jacob-meacham/angular-notification-icons

第一步正在运行:

 npm install angular-notification-icons --save

我不确定运行此路径需要什么?我尝试在项目路径中运行它,但出现此错误:

npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "angular-notification-icons" under a package
npm ERR! also called "angular-notification-icons". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!

1 个答案:

答案 0 :(得分:1)

package.json 中的项目名称与 npm 模块名称相似的问题原因。

要解决此问题,请将 package.json 中的项目名称更改为其他名称。

示例“ angular-notification-icons-test”

{
  "name": "angular-notification-icons-test",
  "version": "0.0.0",
  "scripts": {
      "ng": "ng",
      "start": "ng serve",
      "build": "ng build",
      "test": "ng test",
      "lint": "ng lint",
      "e2e": "ng e2e"
  },
  ...
}