-1

在尝试使用 Angular 创建一个新项目时,我ng new my-dream-app在命令提示符中使用了该命令,并收到以下错误消息:

 Installing packages...npm WARN deprecated tslint@6.1.1: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents@1.2.12: fsevents 1 will break on node v14+. Upgrade to fsevents 2 with massive improvements.
npm ERR! Unexpected end of JSON input while parsing near '...t-config-prettier":"^'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Izormen Onotieose\AppData\Roaming\npm-cache\_logs\2020-04-21T14_21_50_827Z-debug.log
× Package install failed, see above.

请问我该怎么做?

4

2 回答 2

4

看起来这是一个缓存错误。试试这个:

npm cache clean --force
npm install -g @angular/cli

干杯!

于 2020-04-21T15:03:43.873 回答
3

尝试清理缓存并重新安装全局 Angular CLI。

以管理员身份打开 CMD 并运行

npm cache clean --force
npm install -g @angular/cli
于 2020-04-21T15:04:07.063 回答