5

运行命令npm run ngcc会引发错误'ngcc' is not recognized as an internal or external command

package.json

{
  "scripts": {
    "ngcc": "ngcc"
    ...
  },
  "dependencies": {
    "@angular-extensions/elements": "^9.3.0",
    "@angular/animations": "~9.1.0",
    "@angular/common": "~9.1.0",
    "@angular/compiler": "~9.1.0",
    "@angular/core": "~9.1.0",
    "@angular/elements": "~9.1.0",
    "@angular/forms": "~9.1.0",
    "@angular/platform-browser": "~9.1.0",
    "@angular/platform-browser-dynamic": "~9.1.0",
    "@angular/router": "~9.1.0",
    ...
  }
}

anuglar-compiler 和其他包的版本是否有任何不匹配?无法找到问题的根本原因。有人可以帮忙吗?

4

1 回答 1

4

你试过运行“npm ci”吗?它为我解决了这个问题,看来我的 cli 安装不正确。https://preview-docs.npmjs.com/cli-commands/npm-ci

于 2021-04-13T10:40:12.277 回答