Angular-cli错误:无法找到模块' @ ngtools / json-schema'

时间:2018-01-09 20:23:33

标签: angular npm angular-cli

我最近在我的项目中运行了npm update。完成之后,无论何时我尝试运行服务,我都会得到一个

  

错误:找不到模块' @ ngtools / json-schema'

但是在我的node_modules文件中,非常清楚地存在@ngtools文件。我尝试卸载并重新安装angular-cli但仍然收到此错误。

的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"
}

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:3)

我看到一个可能的错误:

  • 确保您运行npm update --save或不保存任何更改

如果仍然出现错误,请按以下步骤操作:

  • rm -rf node_modules
  • 删除package-lock.json
  • npm install