📌  相关文章
📜  SyntaxError:在“...版本”附近解析时 JSON 输入意外结束:“2.0.6”,“devD” cli - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:26.334000             🧑  作者: Mango

代码示例2
This is not a definitive answer but it looks like your global packages are corrupted in some way.

This bug may be caused by many different things. I suggest doing the following.

1 Install Node Version Manager (or NVM for Windows) and install Node version 10.16.1. This is enough for angular 9 and from my experience it is the most stable version for development. This should also change your NPM version so that may also help.
2 Uninstall global angular package npm uninstall -g @angular/cli
3 Force clear cache npm cache clean --force
4 Just to double check npm cache verify
5 You can also try clearing your %temp% and %roaming% AppData/npm-cache
6 install latest angular package npm install -g @angular/cli@
7 if this error still occurs, consider using another shell

If this don't solve the problem try to manually locate the package.json file that is throwing an error and investigate.