“错误:找不到模块'@ angular-devkit/schematics/tasks''关于更新角度cli [英] "Error: Cannot find module '@angular-devkit/schematics/tasks' " on updating angular cli

查看:149
本文介绍了“错误:找不到模块'@ angular-devkit/schematics/tasks''关于更新角度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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆