Angular cli 6 安装错误

Angular cli 6 installation error

当我运行这个命令时,

npm install -g @angular/cli

我收到这个错误,

    npm ERR! Unexpected end of JSON input while parsing near '...npackedSize":87169,"n'    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Krishanu\AppData\Roaming\npm-cache\_logs18-08-26T09_25_38_336Z-debug.log

我在 windows 系统上。事情是前一天在 linux 上工作,现在在 linux 我无法创建任何应用程序,

ng new ngapp

此命令显示相同的错误。我尝试切换到不同的网络,但无法正常工作。我还尝试更新 nodenpm.

我是 angular 编程新手,我不知道哪里出了问题。

这可能是缓存的问题,请尝试以下操作,

npm cache clean --force

然后

ng new app

使用 => npm update --以管理员权限保存