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
相关推荐
爱上妖精的尾巴22 分钟前
7-13 WPS JS宏 this 用构造函数自定义类-2,调用内部对象必须用this
开发语言·javascript·wps·jsa
bin915344 分钟前
(文后附完整代码)html+css+javascript 弓箭射击游戏项目分析
前端·javascript·css·游戏·html·前端开发
qq_406176141 小时前
深入剖析JS中的XSS与CSRF漏洞:原理、攻击与防御全指南
服务器·开发语言·前端·javascript
Mr-Wanter2 小时前
vue 数据反显时数字/字母不换行导致的样式问题
前端·javascript·vue.js
梁萌2 小时前
vue项目从npm升级为pnpm
前端·npm·node.js
墨着染霜华2 小时前
npm-cache 怎么迁移出C盘
npm·node.js
m0_740859623 小时前
解决uniapp跳转页面警告:Extraneous non-props attributes ...
前端·javascript·uni-app
一行注释3 小时前
ECharts柱状图横向展示与DataZoom滑动查看实现
开发语言·前端·javascript
踢球的打工仔3 小时前
typescript-类的访问权限public、private、protected
前端·javascript·typescript
Ulyanov3 小时前
Impress.js深度解析
开发语言·前端·javascript·css3·impress.js