NPM错误:Eintegrity:完整性校验和使用SHA 512失败

运行 npm install 命令时遇到此问题。几乎在论坛上尝试了关于强制清理缓存、清理 npm 安装并删除 node_modules 和 package-lock.json 等的所有内容。

没有任何工作。希望了解根本原因以及我能做些什么。调试日志如下:

lerna ERR! npm run precommit exited 1 in '<folder>'
husky > pre-commit hook failed (add --no-verify to bypass)
PS C:UsersT955082DocumentsGitHubcio-iof-bird-uipackagescio-iof-bird-report-ui> npm install
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, 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 WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_moduleschokidarnode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modulesjest-haste-mapnode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code EINTEGRITY
npm ERR! sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA== integrity checksum failed when using sha512: wanted sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA== but got sha512-qILHacp4rxtTdIkkEvz0OdxpExfzZ0zlqJ0rBUx1RFmSH86OtRpKIprmsFrfCS837gV9yDDyQqdxD8diFsKqwQ==. (64727 bytes)
stack overflow NPM ERROR: EINTEGRITY: Integrity checksum failed using sha 512
原文答案

答案:

作者头像

删除 node_modules 和 package-lock.json 文件。

运行 npm cache clear --force

然后再试一次。