npm 错误!提取@agm/core@1.0.0-beta.3时验证失败:

mus*_*ang 1 node.js npm npm-install angular

我正在尝试使用以下命令在我的项目中安装 npm

npm install
Run Code Online (Sandbox Code Playgroud)

我收到这个错误

npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting @agm/core@1.0.0-beta.3:
npm ERR! Verification failed while extracting @agm/core@1.0.0-beta.3:
npm ERR! sha512- 
nsyergarmMB4JCw7KGujj86ulgRYhEk8zXKRiJZdnju/irLvazQ/9Anlfsf1Rc5ypach8sZrmQDwqLGZ6AqHhnzA== integrity 
checksum failed when using sha512: wanted sha512- 
nsyergarmMB4JCw7KGujj86ulgRYhEk8zXKRiJZdnju/irLvazQ/9Anlfsf1Rc5ypach8sZrmQDwqLGZ6AqHhnzA== but got 
sha512-nsyergarmMB4JCw7KGujj86ulgRYhEk8zXKRiJZdnju/irLvazQ/9Anlfsf1Rc5yph8sZrmQDwqLGZ6AqHhnzA==. 
(92638 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\hsr\AppData\Roaming\npm-cache\_logs\2019-12-11T10_49_11_550Z-debug.log
Run Code Online (Sandbox Code Playgroud)
  • 我尝试使用全局安装最新的 npm--force但出现相同的错误

Shu*_*ari 5

删除 package-lock.json 和 node_modules 并进行全新安装:

$ rm -rf package-lock.json node_modules
$ npm install

如果不起作用再试一次,使用临时清理缓存:

$ rm -rf package-lock.json node_modules
$ npm install --cache /tmp/empty-npm-cache
如果这解决了问题,请清除全局 npm 缓存以修复损坏。

确保您的网络连接和代理设置 153 正常。
将您的 Node 和 npm 版本更新到最新的稳定版本。