简体   繁体   中英

Angular-cli Error: Cannot find module '@ngtools/json-schema'

I recently ran npm update in my project. After that completed, anytime i try to run ng serve I get a

Error: Cannot find module '@ngtools/json-schema'

However in my node_modules file there is very clearly a @ngtools file present. I tried uninstalling and reinstalling angular-cli but still receive this error.

package.json

"dependencies": {
"@angular/animations": "^4.4.6",
"@angular/cdk": "^2.0.0-beta.12",
"@angular/common": "^4.4.6",
"@angular/compiler": "^4.4.6",
"@angular/core": "^4.4.6",
"@angular/forms": "^4.4.6",
"@angular/http": "^4.4.6",
"@angular/material": "^2.0.0-beta.12",
"@angular/platform-browser": "^4.4.6",
"@angular/platform-browser-dynamic": "^4.4.6",
"@angular/router": "^4.4.6",
"auth0-js": "^8.11.3",
"auth0-lock": "^10.24.1",
"bootstrap": "^3.3.7",
"chart.js": "^2.7.1",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"ng2-charts": "^1.6.0",
"rxjs": "^5.5.2",
"zone.js": "^0.8.4"
},

  "devDependencies": {
"@angular/cli": "^1.5.2",
"@angular/compiler-cli": "^4.4.6",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.92",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0",
"webpack": "^3.8.1"
}

Any help would be much appreciated.

I see one possible mistake:

  • Make sure you run npm update --save or no changes will be saved

If you still get the errors, follow these steps:

  • rm -rf node_modules
  • Delete package-lock.json
  • npm install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM