node_modules/@angular/material/table/cell.d.ts中的错误-Typescript版本问题角度

问题描述

我在项目中使用了angular,所以我遇到了这个问题,我试图将我的打字稿降级为3.9.7,但在我的 package.json 悬念中仍然无法正常工作。

    "private": true,"dependencies": {
    "@angular-devkit/core": "^10.1.3","@angular-devkit/schematics": "^10.1.3","@angular-material-components/datetime-picker": "^4.0.2","@angular/animations": "^10.1.3","@angular/cdk": "^10.0.0","@angular/common": "^10.1.3","@angular/compiler": "~10.1.3","@angular/core": "^10.1.3","@angular/forms": "^10.1.3","@angular/google-maps": "^10.0.1","@angular/material": "^10.0.0","@angular/platform-browser": "^10.1.3","@angular/platform-browser-dynamic": "~10.1.3","@angular/router": "^10.1.3","@angular/typescript": "^2.0.0-5d0e199","@auth0/angular-jwt": "^4.0.0",

有人可以给我一个解决这个问题的想法吗

enter image description here

解决方法

对我来说,重新安装最新版本很有帮助:

npm remove @angular/material @angular/cdk
npm i @angular/material@latest @angular/cdk@latest

如果有纱线,请用纱代替npm。

,

我删除了Material文件夹并安装了npm install @ angular / material @ ^ 10.1.3并将@ angular / core降级到10.1.3 我使用最新版本的angular创建了一个新项目,然后复制cell.d.ts文件并将其粘贴到我的项目中,并且现在可以正常工作

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...