yarn的安装和使用

windows mac 环境 yarn的安装和使用

yarn安装

cmd 复制代码
npm install -g yarn

yarn设置代理

cmd 复制代码
yarn config set registry https://registry.npm.taobao.org -g

yarn官方源

cmd 复制代码
yarn config set registry https://registry.yarnpkg.com

yarn使用

cmd 复制代码
// 查看板本
yarn --version

// 安装指定包
yarn add xxxxxx

// 安装所有包
yarn add  或 yarn install

// 更新指定包
yarn upgrade xxxxxx

// 删除指定包
yarn remove xxxxxx

国内镜像源

cmd 复制代码
yarn config set registry xxxxxx

// 淘宝镜像
https://registry.npm.taobao.org/

// 华为镜像
https://mirrors.huaweicloud.com/repository/npm/

yarn安装问题

yarn安装sass失败

设置 node-sass 地址

cmd 复制代码
// 阿里源
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

// 华为源
yarn config set sass_binary_site https://mirrors.huaweicloud.com/node-sass -g

// 安装 sass-loader node-sass
npm i sass-loader node-sass -D
相关推荐
2401_892000522 小时前
Flutter for OpenHarmony 猫咪管家App实战 - 添加提醒实现
前端·javascript·flutter
Yolanda942 小时前
【项目经验】vue h5移动端禁止缩放
前端·javascript·vue.js
EndingCoder3 小时前
案例研究:从 JavaScript 迁移到 TypeScript
开发语言·前端·javascript·性能优化·typescript
Amumu121385 小时前
Vue脚手架(二)
前端·javascript·vue.js
lichenyang4536 小时前
从零开始构建 React 文档系统 - 完整实现指南
前端·javascript·react.js
比特森林探险记6 小时前
Hooks、状态管理
前端·javascript·react.js
比特森林探险记6 小时前
组件通信 与 ⏳ 生命周期
前端·javascript·vue.js
海绵宝龙7 小时前
Vue中nextTick
前端·javascript·vue.js
H_z_q24017 小时前
Web前端制作一个评论发布案例
前端·javascript·css
摘星编程7 小时前
React Native + OpenHarmony:useId唯一标识生成
javascript·react native·react.js