vue3项目yarn install 安装依赖时报错怎么解决?

vue3项目yarn install 安装依赖时报错

yarn install v1.22.22ew-backend-pc>yarn install
[1/4] Resolving packages...
[2/4] Fetching packages...
error https://registry.npmmirror.com/gifsicle/-/gifsicle-5.3.0.tgz: Integrity check failed for "gifsicle" (computed integrity doesn't match our
 records, got "sha512-FJTpgdj1Ow/FITB7SVza5HlzXa+/lqEY0tHQazAJbuAdvyJtkH4wIdsR2K414oaTwRXHFLLF+tYbipj+OpYg+Q== sha1-SZcTxvHonrvDYw2jp0/bRpeRO04
=")
[3/4] Linking dependencies...
warning " > @vue-office/docx@1.6.2" has unmet peer dependency "vue-demi@^0.14.6".
warning " > @vue-office/excel@1.7.11" has unmet peer dependency "vue-demi@^0.14.6".
warning " > @vue-office/pdf@2.0.9" has unmet peer dependency "vue-demi@^0.14.6".
warning " > eslint-config-prettier@8.6.0" has incorrect peer dependency "eslint@>=7.0.0".
warning " > eslint-plugin-prettier@4.2.1" has incorrect peer dependency "eslint@>=7.28.0".
warning " > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
warning " > script-ext-html-webpack-plugin@2.1.5" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0".
warning " > script-ext-html-webpack-plugin@2.1.5" has unmet peer dependency "html-webpack-plugin@^3.0.0 || ^4.0.0".
warning " > terser-webpack-plugin@4.2.3" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
error Error: ENOENT: no such file or directory, open 'C:\Users\AM-CX-0916\AppData\Local\Yarn\Cache\v6\npm-gifsicle-5.2.1-efadab266a493ef0b4178e
34597493349937369e-integrity\node_modules\gifsicle\.yarn-metadata.json'
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

删除了node_modules,清除了yarn缓存,重新安装也不行

阅读 446
2 个回答

1.更新校验和: 你可以使用 --update-checksums 选项来强制更新校验和:

yarn install --update-checksums

2.删除 yarn.lock 文件并重新安装: 有时 yarn.lock 文件中的信息可能会导致冲突。删除 yarn.lock 文件并重新安装依赖:

rm yarn.lock
yarn install

3.清除缓存并重新安装: 清除缓存后重新安装依赖,确保没有缓存问题:

yarn cache clean
rm -rf node_modules
yarn install

如果以上没解决,可以试下手动安装

手动安装 gifsicle 包

yarn add gifsicle

可能是node版本问题,建议用nvm安装不同node版本,再根据你项目的vue版本去换不同的nodo版本

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏