使用ng new创建新项目时出现问题

时间:2020-05-04 12:03:17

标签: angular angular-cli

/ Installing packages...npm WARN deprecated tslint@6.1.2: 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 chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.12: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...ball":"https://regist'

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

The Schematic workflow failed. See above.

我尝试使用以下方法解决此问题:

  1. npm uninstall -g @angular/cli
  2. npm cache verify
  3. npm install -g @angular/cli@latest

但是它不起作用

我的angular版本:

 Angular CLI: 9.1.4
 Node: 12.16.3
 OS: win32 x64

1 个答案:

答案 0 :(得分:1)

我面对angular-cli-9遇到了同样的问题。您可以尝试将角度CLI降级到版本8。这对我有用

npm uninstall -g angular-cli
npm cache clean
npm i -g @angular/cli@8.3.26