Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular CLI: creating service Error: classify is not defined after npm install

Hi i have very strange problem, before run comand

sudo npm install

in angular 5 project, i can creating modules, components, and services via ng. After:

sudo npm install

When i want to create for example service:

sudo ng generate service myName

I get error:

Error: classify is not defined, classify is not defined

Version node: 9.5.0
Version npm: 5.6.0
Angular CLI: 1.7.1
Angular: 5.2.6

My 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"

Thanks for help.

like image 863
Kaker Avatar asked Feb 22 '18 16:02

Kaker


Video Answer


1 Answers

I just ran into this issue, and updating Angular DevKit worked for me:

$ npm i -D @angular-devkit/core@latest
like image 193
jptrue Avatar answered Sep 26 '22 15:09

jptrue