发布于 4年前

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

使用yarn添加jest:

yarn add --dev jest

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

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

解决方案:

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

yarn cache clean<br></br>yarn add --dev jest

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

©2020 edoou.com   京ICP备16001874号-3