离子项目的npm安装失败

时间:2019-06-11 05:23:58

标签: ionic-framework npm angular7 npm-install

嗨,当我尝试安装 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\_logs\2019-06-11T05_18_26_257Z-debug.log
PS D:\ENDART\DART-MOBILE>

我尝试了这种解决方案。但是并没有解决。 Installing create-react-app gives npm ERR! shasum check failed and npm ERR! Unexpected end of JSON input while parsing near '...mojOzGIEI2rg0m24Yb5Oq'

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

如何解决这个问题。

1 个答案:

答案 0 :(得分:1)

如果您在环境中配置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