无法确定@ angular/compiler-cli和打字稿的版本 [英] Versions of @angular/compiler-cli and typescript could not be determined
问题描述
我已经安装了Angular/cli,然后尝试运行ng serve命令,然后抛出以下错误.我已经尝试了很多事情,例如卸载angular/cli,npm cache clean等
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和打字稿的版本不能 决定.最常见的原因是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中键入,然后删除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和打字稿的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!