npm和yarn相关设置

镜像站

查询当前镜像

npm get registry  # npm
yarn config get registry  # yarn

修改镜像站

npm config set registry https://registry.npmmirror.com  # npm
yarn config set registry https://registry.npmmirror.com  # yarn

代理

查询代理

# npm
npm get proxy
npm get https-proxy

# yarn
yarn config get proxy
yarn config get https-proxy

修改代理

# npm
npm set proxy http://[ip]:[port]
npm set https-proxy http://[ip]:[port]

# yarn
yarn config set proxy http://[ip]:[port]
yarn config set https-proxy http://[ip]:[port]

删除代理

# npm
npm delete proxy
npm delete https-proxy

# yarn
yarn config delete proxy
yarn config delete https-proxy
posted @ 2022-10-06 14:20  ももねこ  阅读(63)  评论(0)    收藏  举报