yarn install遇到问题处理

1、Yarn在尝试安装一个依赖项时遇到了问题。具体来说,这个错误指出期望提升(hoist)的包的manifest文件丢失了,这通常是因为缓存中的数据损坏或不一致所致。

解决方法:有以下两种

1、清除Yarn缓存:运行 yarn cache clean 清除缓存,然后再次尝试 yarn install。

2、删除 node_modules 文件夹和 yarn.lock 文件:删除项目中的 node_modules 文件夹和 yarn.lock 文件,然后重新运行 yarn install。

2、网络问题,一直链接不上yarn

解决办法,切换成淘宝镜像

1、Yarn设置淘宝镜像

javascript 复制代码
查询当前配置的镜像
yarn config get registry https://registry.yarnpkg.com
设置成淘宝镜像
yarn config set registry https://registry.npmmirror.com // 淘宝镜像新域名,旧域名2024年1月1日过期弃用
换成原来的镜像
yarn config set registry https://registry.yarnpkg.com

2、NPM设置淘宝镜像

javascript 复制代码
查询当前配置的镜像
npm get registry
设置成淘宝镜像
npm config set registry https://registry.npmmirror.com
换成原来的镜像
npm config set registry https://registry.npmjs.org

我先试用的是以下的办法

javascript 复制代码
先把node-sass镜像源进行设置成国内的
yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass

然后将资源地址设置为淘宝镜像

yarn config set registry http://registry.npm.taobao.org/
记得查看一下自己是否更改成功

yarn config get registry
相关推荐
Yolo@~3 小时前
个人网站:基于html、css、js网页开发界面
javascript·css·html
斯~内克3 小时前
Electron 菜单系统深度解析:从基础到高级实践
前端·javascript·electron
dr李四维3 小时前
vue生命周期、钩子以及跨域问题简介
前端·javascript·vue.js·websocket·跨域问题·vue生命周期·钩子函数
旭久3 小时前
react+antd中做一个外部按钮新增 表格内部本地新增一条数据并且支持编辑删除(无难度上手)
前端·javascript·react.js
朴拙数科4 小时前
技术长期主义:用本分思维重构JavaScript逆向知识体系(一)Babel、AST、ES6+、ES5、浏览器环境、Node.js环境的关系和处理流程
javascript·重构·es6
拉不动的猪5 小时前
vue与react的简单问答
前端·javascript·面试
旭久6 小时前
react+antd封装一个可回车自定义option的select并且与某些内容相互禁用
前端·javascript·react.js
阿丽塔~6 小时前
React 函数组件间怎么进行通信?
前端·javascript·react.js
冴羽6 小时前
SvelteKit 最新中文文档教程(17)—— 仅服务端模块和快照
前端·javascript·svelte