1

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.

4
  • Share your package.json file Commented Jan 9, 2018 at 20:28
  • There is no @ngtools/json-schema in your dependencies... Commented Jan 9, 2018 at 20:33
  • @user184994 I haven't had it in my list of dependencies previously and ng-cli ran fine Commented Jan 9, 2018 at 20:42
  • Have you tried running npm install --save @ngtools/json-schema to see if that works? Commented Jan 9, 2018 at 20:44

1 Answer 1

6

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
Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the answer @austinthedeveloper. I am running windows so i had to find the equivalent of rm and -rf but it worked!
Drag and drop node_modules to trash can? ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.