gpt4 book ai didi

node.js - Angular CLI : creating service Error: classify is not defined after npm install

转载 作者:太空狗 更新时间:2023-10-29 17:30:31 25 4
gpt4 key购买 nike

嗨,我有一个很奇怪的问题,在运行命令之前

sudo npm install

在 Angular 5 项目中,我可以通过 ng 创建模块、组件和服务。之后:

sudo npm install

当我想创建例如服务时:

sudo ng generate service myName

我得到错误:

Error: classify is not defined, classify is not defined

版本 Node :9.5.0
版本 npm:5.6.0
Angular CLI:1.7.1
Angular :5.2.6

我的 package.json:

"@angular/cli": "^1.6.5",
"@angular-devkit/schematics": "0.0.42",
"@angular-devkit/core": "0.0.23",
"@angular/compiler-cli": "^5.2.1",
"@angular/language-service": "^5.2.1",
"@types/jasmine": "^2.8.5",
"@types/jasminewd2": "^2.0.3",
"@types/node": "^6.0.96",
"codelyzer": "^4.1.0",
"jasmine-core": "^2.9.1",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^1.7.1",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.3.3",
"karma-jasmine": "^1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "^3.3.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"

感谢您的帮助。

最佳答案

我刚遇到这个问题,更新 Angular DevKit 对我有用:

$ npm i -D @angular-devkit/core@latest

关于node.js - Angular CLI : creating service Error: classify is not defined after npm install,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48932057/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com