【问题标题】:Error: npm install -g angular-cli npm ERR错误:npm install -g angular-cli npm ERR
【发布时间】:2023-11-24 21:56:01
【问题描述】:
npm i
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 fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! Unexpected end of JSON input while parsing near '...lar/compiler-cli/-/co'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/lookang/.npm/_logs/2020-05-20T09_09_02_104Z-debug.log
[ERROR] An error occurred while running subprocess npm.

【问题讨论】:

    标签: angular ionic-framework npm


    【解决方案1】:

    如果您收到此错误,只需按照以下步骤操作,解决方案是在清除 npm 缓存后重新安装 Angular CLI

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

    【讨论】: