离子项目的 npm 安装失败

npm install fails for ionic project

您好,当我尝试安装 ionic-angular 时遇到此错误

PS D:\ENDART\DART-MOBILE> npm install ionic-angular
npm ERR! Unexpected token } in JSON at position 423538 while parsing near '...gZvBqA=="
npm ERR!     }
npm ERR!   }
npm ERR! }
npm ERR! '

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\NIKITHRA\AppData\Roaming\npm-cache\_logs19-06-11T05_18_26_257Z-debug.log
PS D:\ENDART\DART-MOBILE>

我试过这个解决方案。但是没有解决。

PS D:\ENDART\DART-MOBILE> npm config set registry "https://registry.npmjs.com/"
PS D:\ENDART\DART-MOBILE> npm cache clear --force
npm WARN using --force I sure hope you know what you are doing.
PS D:\ENDART\DART-MOBILE> npm cache verify
Cache verified and compressed (~\AppData\Roaming\npm-cache\_cacache):
Content verified: 0 (0 bytes)
Index entries: 0
Finished in 0.036s

如何解决这个问题。

如果您在您的环境中配置 HTTP_PROXY

http://username:password@proxy.server.com:port

npm config rm proxy
npm config rm https-proxy

然后试试这个:

rm -f package-lock.json 

然后

npm install