1. 程式人生 > 實用技巧 >node.js yarn 更新源

node.js yarn 更新源

#1 管理員許可權執行 docker 
docker stop taro
docker rm taro

#docker run -itd --name taro node:latest
docker run -itd -v $PWD/:/home/taro --name taro node:latest

docker exec -it taro /bin/bash
#下面程式碼是換源
npm config get registry npm config set registry https:
//registry.npm.taobao.org/ yarn config get registry yarn config set registry https:
//registry.npm.taobao.org/ npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ yarn config delete proxy npm config rm proxy npm config rm https-proxy yarn global add mirror-config-china yarn global add node-sass yarn global add @tarojs
/cli yarn install npm rebuild node-sass --save-dev yarn run dev:weapp

mac 下,得把yarn 全域性包 位置修改了 快取包位置也得改

#全域性位置
yarn config  set global-folder /Users/wqk/Softwares/.........位置自己選
#快取位置
yarn config set cache-folder /Users/wqk/Softwares/.........位置自己選

這樣基本沒啥許可權問題了