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 install
,yarn add --dev jest
但无济于事。
我该如何解决?
解决方案
yarn cache clean
要解决此问题,请运行:
yarn cache clean
yarn add --dev jest
来自纱线缓存文档:
yarn cache clean [<module_name...>]
运行此命令将清除全局缓存。下次运行 yarn 或 yarn install 时,它将再次填充。此外,您可以指定一个或多个要清理的包。
您还可以查看缓存的位置yarn cache dir
。
yarn cache dir
运行 yarn cache dir 会打印出 yarn 的全局缓存当前存放的路径。
推荐阅读
- android-studio - 无法启动守护进程 - Android Studio Gradle Sync 错误
- python - 为什么输入为 4 时乘积为 24?
- aframe - 我可以在框架中插入 360 度全景照片并与视频和其他工作人员一起工作吗?
- python-3.x - 替换字符串中的特定“var”
- django - Wagtail 根页面不呈现正文内容
- android - 为安卓汽车模拟器设置代理
- java - 如何将文本文件读入固定大小的字符串数组
- testing - 在 ROBOT 框架的变量中添加 Json 数据
- prometheus - 如何在 Spring Cloud Dataflow Server 上使用 /management/prometheus
- python - 将多个操作应用于函数中的单个数据帧的执行方式?