yarnpkg - 从缓存中获取时完整性不正确

标签 yarnpkg

运行 yarn add --dev jest 时,我收到错误:从缓存中获取时完整性不正确

完整输出:

tests (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.

我尝试删除node_modules,重新运行yarn installyarn add --dev jest但无济于事。

如何解决这个问题?

最佳答案

yarn cache clean

要解决此问题,请运行:

yarn cache clean
yarn add --dev jest

来自yarn cache documentation :

yarn cache clean [<module_name...>]

Running this command will clear the global cache. It will be populated again the next time yarn or yarn install is run. Additionally, you can specify one or more packages that you want to clean.

您还可以使用 yarn cache dir 查看缓存的位置.

yarn cache dir

Running yarn cache dir will print out the path where yarn’s global cache is currently stored.

关于yarnpkg - 从缓存中获取时完整性不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58172688/

相关文章:

heroku - Rails 6 和 Tailwind CSS 不会部署到 Heroku

typescript - 如何管理多个 monorepos

javascript - 包与其内部 node_modules 包依赖关系无关,而是使用外部范围

react-native - 错误: jest-haste-map: @providesModule naming collision when using a local dependency

github - 如何在 Github Action 中使用 yarn 安装私有(private)包?

node.js - npm、pnpm、yarn 或 pkglink 是否可以节省时间和磁盘空间?

javascript - 如何在 Yarn 中使用多个 npm 注册表?

yarnpkg - 当我尝试升级某些依赖项时,为什么 Yarn 会抛出 "Invariant Violation: expected workspace package to exist"?

yarnpkg - yarn 在哪里保存全局包?

javascript - yarn ,node-gyp 重建编译错误,node_modules/fsevents : Command failed