A-A+

npm – npm i时提示sha512错误

2020年03月16日 nodejs 暂无评论 阅读 332 次

npm - npm i时提示sha512错误

> npm i

npm ERR! code EINTEGRITY
npm ERR! sha512-d2FbKvYe4XAQx5gjHBoWG+ADqC3fGZzjb7i9vxd/Y5xfLkBGtQyX7aOb8lBRQPYUhjngiD3d49LevjY1stUR0Q== integrity checksum failed when using sha512: wanted sha512-d2FbKvYe4XAQx5gjHBoWG+ADqC3fGZzjb7i9vxd/Y5xfLkBGtQyX7aOb8lBRQPYUhjngiD3d49LevjY1stUR0Q== but got sha512-Mvs6ofsc2xTjeZIrMaIfbXfsPVrbdVy/cVqq6SAacnqfMlcBpDuivhWZ1ODGeJ8HgmyWTLH971PYjj/EPCDVAw==. (27908 bytes)

下载npm包的时候,会进行包的哈希检测,以防下载的包被人恶意篡改,然而有时候因为cnpm与npm混用导致这个问题,

解决方法

As a workaround, follow the below steps:
• Go to the project directory
• Remove the node_modules directory: rm -rf node_modules.
• Remove package-lock.json file: rm package-lock.json
• Clear the cache: npm cache clean --force
• Run npm install --verbose
If after following the above steps still the issue exists then please provide us the output of installation command with --verbose.
rm -r package-lock.json node-modules && npm cache clean --force && npm install
标签:

给我留言

Copyright © web前端技术开发个人博客 保留所有权利  京ICP备14060653号 Theme  Ality

用户登录