【问题标题】:How can I solve Angular CLI ng new error?如何解决 Angular CLI ng 新错误?
【发布时间】:2019-08-21 20:27:51
【问题描述】:

我正在尝试使用 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

所以,为了获得我运行的默认 Angular 应用程序:

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.

问题是我该如何解决这个问题?

【问题讨论】:

  • 你试过重新安装@angular/cli吗?

标签: json npm angular-cli


【解决方案1】:

这是某种与 npm 相关的问题。我刚刚跑了

npm cache clean --force

它成功了!

【讨论】:

    猜你喜欢
    • 2021-12-07
    • 2022-08-11
    • 1970-01-01
    • 1970-01-01
    • 2019-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    相关资源
    最近更新 更多