如何修复 "Cannot find module '@angular-devkit/schematics' "

how to fix "Cannot find module '@angular-devkit/schematics' "

我正在尝试更新 Angular。所以我 运行 ng update --all 在我用 vs-2015 创建的 Angular 项目中从 CMD 运行 ng update --all 并且在 return 我的项目中出现了另一个错误:

Error TS2345 Argument of type '{ imports: typeof BrowserModule[]; declarations: typeof AppComponent[]; bootstrap: typeof AppComp...' is not assignable to parameter of type 'NgModule'.

Property 'true' is missing in type '{ imports: typeof BrowserModule[]; declarations: typeof AppComponent[]; bootstrap: typeof AppComp...'.

TypeScript Virtual Projects c:\users\lesibamo\documents\visual studio 2015\Projects\Angular4demo\Angular4demo\src\app\app.module.ts 6 Active

  1. 删除您的 package-lock.json 文件
  2. 删除 angular 项目中的节点 node_modules 文件夹
  3. 打开您的命令提示符并浏览您的 Angular 项目文件夹,键入 npm update
  4. 通过ng --version
  5. 确认Angular版本
  6. 运行 你的项目 ng serve 如果更新成功,项目应该加载没有错误