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
相关推荐
ᖰ・◡・ᖳ35 分钟前
JavaScript:PC端特效--缓动动画
开发语言·前端·javascript·css·学习·html5
c_zyer3 小时前
使用 nvm 管理 Node.js 和 npm 版本
前端·npm·node.js
布Coder3 小时前
前端 vue + element-ui 框架从 0 - 1 搭建
前端·javascript·vue.js
人鱼小姐ww3 小时前
cmd里可以使用npm,vscode里使用npm 报错
vscode·npm
收费界的一股清流3 小时前
npm 安装时 SSL 证书过期问题笔记
笔记·npm·ssl
小刘不知道叫啥5 小时前
简单说一下 Webpack分包
前端·javascript·webpack·node.js
MessiGo5 小时前
Javascript 编程基础(2)基础知识 | 2.1、javascript与Node.js
开发语言·javascript·node.js
前端达人6 小时前
React 播客专栏 Vol.13|样式不难搞,Tailwind CSS 与 SVG 实战入门
前端·javascript·css·react.js·前端框架
xcs194056 小时前
开发 前端搭建npm v11.4.0 is known not to run on Node.js v14.18.1.
前端·npm·node.js
W.Y.B.G7 小时前
vue3 vite 项目中自动导入图片
前端·javascript·vue.js