Angular CLI:创建服务错误:在npm install之后未定义classify

时间:2018-02-22 16:08:33

标签: node.js angular

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

  

sudo npm install

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

  

sudo npm install

当我想创建例如服务时:

  

sudo ng generate service myName

我收到错误:

  

错误:未定义分类,未定义分类

版本节点: 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"

感谢您的帮助。

1 个答案:

答案 0 :(得分:12)

我刚遇到这个问题,更新Angular DevKit为我工作:

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