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
相关推荐
kyriewen7 小时前
别再 console.log 了:5 个 Chrome DevTools 调试技巧,用过就回不去了
前端·javascript·面试
To_OC9 小时前
LC 1 两数之和:面试第一道必考题,暴力解法直接被面试官 pass
javascript·算法·leetcode
GuWenyue11 小时前
排序效率低?5分钟吃透快速排序,性能飙升至O(nlogn)
前端·javascript·面试
何时梦醒11 小时前
深入理解递归与快速排序 —— 从基础入门到手写实现
前端·javascript
bonechips11 小时前
LLM 的无状态:从 HTTP 协议到对话上下文工程
前端·javascript
胡志辉11 小时前
从 prototype 到 V8,看懂 JavaScript 原型链
前端·javascript
ping某13 小时前
专栏-null 和 undefined 到底是什么?
前端·javascript·后端
swipe15 小时前
从 0 到 1 理解 React 虚拟列表:定高、不定高与 Canvas 版本完整拆解
前端·javascript·面试
铁皮饭盒16 小时前
Bun执行python代码
前端·javascript·后端
zzzzzz31018 小时前
当甲方说'logo放大的同时再缩小一点'时,我用 AI 把这个需求做出来了
javascript·css·程序员