我正在尝试使用angular / cli命令安装新的Angular项目:
ng new app-name
我的工具是:
ng --version
Angular CLI: 8.2.2
Node: 10.16.3
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.802.2
@angular-devkit/core 8.2.2
@angular-devkit/schematics 8.2.2
@schematics/angular 8.2.2
@schematics/update 0.802.2
rxjs 6.4.0
因此,为了获得默认的角度应用程序,我运行:
ng new app-name
选择从样式添加路由和CSS。
我得到以下输出:
npm ERR! Unexpected end of JSON input while parsing near '...pes/gulp":"3.X","@typ'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\gusenica\AppData\Roaming\npm-cache\_logs\2019-08-20T15_56_11_846Z-debug.log
Package install failed, see above.
问题是如何解决此问题?
答案 0 :(得分:3)
这是某种与npm相关的问题。我刚跑
npm cache clean --force
成功了!