[feature] add npm/cnpm

This commit is contained in:
Klesh Wong 2020-10-20 16:16:37 +08:00
parent 0199b4c5db
commit ccf2412098

View File

@ -7,10 +7,10 @@ DIR=$(readlink -f $(dirname $0))
# install nodejs and yarn
case "$PM" in
apt)
sudo apt install -y nodejs yarnpkg
sudo apt install -y nodejs npm yarnpkg
;;
pacman)
sudo pacman -S --needed nodejs yarn
sudo pacman -S --needed nodejs npm yarn
;;
esac
@ -24,6 +24,7 @@ fi
# config mirrors for CHINA
if in-china; then
sudo npm install cnpm -g --registry=https://r.npm.taobao.org
yarnpkg config set registry https://registry.npm.taobao.org --global && \
yarnpkg config set disturl https://npm.taobao.org/dist --global && \
yarnpkg config set sass_binary_site https://npm.taobao.org/mirrors/node-sass --global && \
@ -33,9 +34,9 @@ if in-china; then
yarnpkg config set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver --global && \
yarnpkg config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs --global && \
yarnpkg config set selenium_cdnurl https://npm.taobao.org/mirrors/selenium --global && \
yarnpkg config set sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/" --global && \
yarnpkg config set profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/" --global && \
yarnpkg config set chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver" --global && \
yarnpkg config set sqlite3_binary_host_mirror https://foxgis.oss-cn-shanghai.aliyuncs.com/ --global && \
yarnpkg config set profiler_binary_host_mirror https://npm.taobao.org/mirrors/node-inspector/ --global && \
yarnpkg config set chromedriver_cdnurl https://cdn.npm.taobao.org/dist/chromedriver --global && \
yarnpkg config set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector --global && \
yarnpkg config set sentrycli_cdnurl 'https://npm.taobao.org/mirrors/sentry-cli'
yarnpkg config set sentrycli_cdnurl https://npm.taobao.org/mirrors/sentry-cli
fi