"错误:找不到模块'@angular-devkit/schematics/tasks' "关于更新角度cli [英] "Error: Cannot find module '@angular-devkit/schematics/tasks' " on updating angular cli
问题描述
在项目根文件夹中更新 angular cli 时遇到错误.
When updating angular cli in project root folder I run into an error.
运行这个命令:ng update @angular/cli
返回以下错误
Error: Cannot find module '@angular-devkit/schematics/tasks'
Cannot find module '@angular-devkit/schematics/tasks'
我尝试删除节点模块文件然后运行 npm install,也尝试运行 npm i @angular-devkit/schematics
但错误仍然存在.
I tried removing node modules file then run npm install, also tried running npm i @angular-devkit/schematics
but the error persists.
本地 CLI 版本:1.7.4,全局 CLI 版本:7.3.7
local CLI version: 1.7.4, global CLI version: 7.3.7
推荐答案
Run npm update -g @angular/cli
然后在版本 clousre 前添加 '^'
关注
Run npm update -g @angular/cli
then add '^'
before the version clousre like follows
"@angular/cli": "^1.7.4"
删除package-lock.json
文件和node_modules
目录.然后运行 npm i
或使用 npm update
来更新你的工作区.
Delete package-lock.json
file and node_modules
directory. Then run npm i
or use npm update
to update your workspace.
这篇关于"错误:找不到模块'@angular-devkit/schematics/tasks' "关于更新角度cli的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!