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
相关推荐
belldeep14 分钟前
python:用 Flask 3 , mistune 2 和 mermaid.min.js 10.9 来实现 Markdown 中 mermaid 图表的渲染
javascript·python·flask
凉辰33 分钟前
使用uni.createInnerAudioContext()播放指定音频(踩坑分享功能)
开发语言·javascript·音视频
echoVic1 小时前
多模型支持的架构设计:如何集成 10+ AI 模型
java·javascript
echoVic1 小时前
AI Agent 安全权限设计:blade-code 的 5 种权限模式与三级控制
java·javascript
David凉宸1 小时前
Vue 3 + TS + Vite + Pinia vs Vue 2 + JS + Webpack + Vuex:对比分析
javascript·vue.js·webpack
何中应1 小时前
MindMap部署
前端·node.js
boooooooom1 小时前
Pinia必学4大核心API:$patch/$reset/$subscribe/$onAction,用法封神!
javascript·vue.js·面试
不会敲代码11 小时前
解密JavaScript内存机制:从执行上下文到闭包的全景解析
javascript
NEXT061 小时前
React Hooks 进阶:useState与useEffect的深度理解
前端·javascript·react.js
踢足球09292 小时前
寒假打卡:2026-2-7
java·开发语言·javascript