Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

常用的 yarn 命令 #187

Open
felix-cao opened this issue Nov 28, 2020 · 3 comments
Open

常用的 yarn 命令 #187

felix-cao opened this issue Nov 28, 2020 · 3 comments

Comments

@felix-cao
Copy link
Owner

felix-cao commented Nov 28, 2020

YarnFacebook 贡献的用于取代 npmJavascript 包管理器。

1.1 查看 yarn 配置信息

yarn config list

1.2 修改 yarn 的源镜像为淘宝源

yarn config set registry https://registry.npm.taobao.org/

1.3 查看 yarn 的 bin 的位置

yarn global bin

1.4 查看 yarn 的全局安装位置

yarn global dir

1.5 修改 yarn 全局安装目录

 yarn config set global-folder "d:\global-folder"

1.6 查看 yarn 全局配置文件 .yarnrc 的位置

yarn config list --verbose

1.7 清理缓存

# 查看当前缓存目录
yarn cache dir
# 清理缓存
yarn cache clean
# 重新设置当前缓存目录
yarn config set cache-folder "d:\yarnCache"

1.8 设置和删除代理

# 设置代理
yarn config set proxy http://127..0.1:10808
yarn confit set https-proxy http://127.0.0.1:10808
#取消代理
yarn config delete proxy
yarn config delete https-proxy

1.9 设置镜像
查看当前配置的镜像

npm get registry
yarn config get registry

设置淘宝镜像

npm config set registry http://registry.npm.taobao.org
yarn config set registry http://registry.npm.taobao.org

换成原来的镜像

npm config set registry http://registry.npmjs.org
yarn config set registry http://registry.npmjs.org
@felix-cao
Copy link
Owner Author

使用yarn安装puppeteer等问题

npm config set PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors
yarn config set registry https://registry.npm.taobao.org/

@felix-cao
Copy link
Owner Author

felix-cao commented Nov 29, 2020

Vue-next 时出现错误:
image
npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist
npm config delete disturl

@felix-cao
Copy link
Owner Author

felix-cao commented Jan 5, 2023

设置 npm 代理

npm config set proxy http://127.0.0.1:10818
npm config set https-proxy http://127.0.0.1:10818
npm config delete proxy
npm config delete https-proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant