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设置淘宝镜像

查询当前配置的镜像
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设置淘宝镜像

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

我先试用的是以下的办法

先把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
翻译以下文档yarn install is used to install all dependencies for a project. This is most commonly used when you have just checked out code for a project, or when another developer on the project has added a new dependency that you need to pick up. If you are used to using npm you might be expecting to use or . These have been replaced by and . For more information, see the yarn add documentation.--save--save-devyarn addyarn add --dev Running with no command will run , passing through any provided flags.yarnyarn install If you need reproducible dependencies, which is usually the case with the continuous integration systems, you should pass flag.--frozen-lockfile yarn install Install all the dependencies listed within in the local folder.package.jsonnode_modules The file is utilized as follows:yarn.lock If is present and is enough to satisfy all the dependencies listed in , the exact versions recorded in are installed, and will be unchanged. Yarn will not check for newer versions.yarn.lockpackage.jsonyarn.lockyarn.lock If is absent, or is not enough to satisfy all the dependencies listed in (for example, if you manually add a dependency to ), Yarn looks for the newest versions available that satisfy the constraints in . The results are written to .yarn.lockpackage.jsonpackage.jsonpackage.jsonyarn.lock If you want to ensure is not updated, use .yarn.lock--frozen-lockfile yarn install --check-files Verifies that already installed files in did not get removed.node_modules yarn install --flat Install all the dependencies, but only allow one version for each package. On the first run this will prompt you to choose a single version for each package that is depended on at multiple version ranges. These will be added to your under a field.package.jsonresolutions "resolutions": { "package-a": "2.0.0", "package-b": "5.0.0", "package-c": "1.5.2" } yarn install --force This refetches all packages, even ones that were previously installed. yarn install --har Outputs an H
03-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值