yarn报错:error Incorrect integrity when fetching from the cache

使用yarn添加jest:

yarn add --dev jest

执行上面的命令时,报错:

lula (master)$ yarn add --dev jest
yarn add v1.19.0
info No lockfile found.
[1/4] Resolving packages...
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
[2/4] Fetching packages...
error Incorrect integrity when fetching from the cache
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

解决方案:

google一下,找到了解决方案,即执行yarn cache clean在继续安装。命令如下:

yarn cache clean
yarn add --dev jest

如果还是解决不了,可以删除~/.cache/yarn里的缓存,在重试

版权声明:著作权归作者所有。

相关推荐

npm报错解决:Error: ENOSPC, write

在Linux使用npm安装mongodb报了ENOSPC的错误,错误信息:# npm install mongodb npm http GET https://registry.npmjs.org/mongodb npm http 200 https://registry.npmjs.org/mongodb