如何为已经创建的Angular项目克服此问题?我想使用2.6.2 Typescript
@angular/compiler-cli@5.2.0 requires typescript@'>=2.4.2 <2.6.0' but 2.6.2 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@'>=2.4.2 <2.6.0'
To disable this warning run "ng set warnings.typescriptMismatch=false".
The "@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'*
答案 0 :(得分:1)
问题很明显......你的角度CLI版本需要一个Typescript低版本。
您需要降级您的Typescript版本。
在你的package.json中更改:
"typescript": "^2.6.2",
用
"typescript": "^2.4.2",
并运行
npm install