找不到模块'@ angular-devkit/schematics/tasks' [英] Cannot find module '@angular-devkit/schematics/tasks'

查看:299
本文介绍了找不到模块'@ angular-devkit/schematics/tasks'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将@angular/material添加到我的项目时,出现此错误.
使用Angular Cli:7.2.1,节点11.6.0

when I try to add @angular/material to my project I get this error.
Using Angular Cli: 7.2.1, Node 11.6.0

找不到模块'@ angular-devkit/schematics/tasks'
错误:找不到模块'@ angular-devkit/schematics/tasks'
   at Function.Module._resolveFilename(内部/模块/cjs/loader.js:603:15)
  在Function.Module._load中(内部/模块/cjs/loader.js:529:25)
   在Module.require中(内部/模块/cjs/loader.js:657:17)
  按需(internal/modules/cjs/helpers.js:22:18)
    at Object. (/Users/ricardobaeza/Projects/node_modules/@angular/material/schematics/ng-add/index.js:10:17)
   在Module._compile中(内部/模块/cjs/loader.js:721:30)
    at Object.Module._extensions..js(internal/modules/cjs/loader.js:732:10)
   在Module.load中(内部/模块/cjs/loader.js:620:32)
   在tryModuleLoad(内部/模块/cjs/loader.js:560:12)
   在Function.Module._load(internal/modules/cjs/loader.js:552:3)

Cannot find module '@angular-devkit/schematics/tasks'
   Error: Cannot find module '@angular-devkit/schematics/tasks'
   at Function.Module._resolveFilename (internal/modules /cjs/loader.js:603:15)
   at Function.Module._load (internal/modules/cjs/loader.js:529:25)
   at Module.require (internal/modules/cjs/loader.js:657:17)
   at require (internal/modules/cjs/helpers.js:22:18)
   at Object. (/Users/ricardobaeza/Projects/node_modules/@angular/material/schematics/ng-add/index.js:10:17)
   at Module._compile (internal/modules/cjs/loader.js:721:30)
   at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
   at Module.load (internal/modules/cjs/loader.js:620:32)
   at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
   at Function.Module._load (internal/modules/cjs/loader.js:552:3)

推荐答案

您的@angular/material命令当前未安装所有依赖项,因此为什么抛出错误并尝试运行@angular/material @angular/cdk @angular/animations安装角材.

Your @angular/material command is not install all the dependency currently that why throw error try to run @angular/material @angular/cdk @angular/animations install angular material.

对于旧版本,请使用:-

For old version use:-

npm install — save @angular/material @angular/cdk @angular/animations

对于最新版本,请使用:-

For latest version use:-

ng add @angular/material

有关更多信息,请访问棱角材料的官方网站 https://material.angular.io/指南/入门

For more information visit official site of angular material https://material.angular.io/guide/getting-started

The ng add command will install Angular Material, the Component Dev Kit (CDK), Angular Animations and ask you the following questions to determine which features to include

这篇关于找不到模块'@ angular-devkit/schematics/tasks'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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