“错误:找不到模块'@ 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
推荐答案
运行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屋!