无法确定 @angular/compiler-cli 和 typescript 的版本 [英] Versions of @angular/compiler-cli and typescript could not be determined

查看:28
本文介绍了无法确定 @angular/compiler-cli 和 typescript 的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Angular/cli,然后尝试运行命令 ng serve 然后抛出以下错误.我尝试了很多东西,比如卸载 angular/cli、npm 缓存清理等

I have installed Angular/cli and then try to run command ng serve then below error is throwing. I have tried lot of thing like uninstall angular/cli, npm cache clean, etc

@angular/compiler-cli 和 typescript 的版本不能决定.最常见的原因是 npm 安装损坏.

Versions of @angular/compiler-cli and typescript could not be determined. The most common reason for this is a broken npm install.

请确保你的 package.json 包含@angular/compiler-cli和 devDependencies 中的 typescript,然后删除 node_modules 和package-lock.json(如果有的话)并再次运行 npm install.

Please make sure your package.json contains both @angular/compiler-cli and typescript in devDependencies, then delete node_modules and package-lock.json (if you have one) and run npm install again.

推荐答案

这可能是不隐式运行 devDependencies 的问题.

This may be a problem in not implicitly running devDependencies.

尝试使用以下命令隐式运行它们.

Try running them implicitly with the command below.

npm install --dev

这篇关于无法确定 @angular/compiler-cli 和 typescript 的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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