我已经安装了 Angular/cli,然后尝试运行命令 ng serve 然后抛出以下错误。我尝试了很多东西,比如卸载 angular/cli、npm 缓存清理等
Versions of @angular/compiler-cli and typescript could not be determined. The most common reason for this is a broken 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 的问题。
尝试使用以下命令隐式运行它们。
npm install --dev
关于angular-cli - 无法确定 @angular/compiler-cli 和 typescript 的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47185611/