mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
23 lines
846 B
Bash
23 lines
846 B
Bash
#!/bin/env bash
|
|
|
|
# install nvm
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
|
|
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
|
|
# install Node.js v8.12
|
|
nvm install 8.12
|
|
|
|
# create soft links
|
|
ln -s $HOME/.nvm/versions/node/v8.12.0/bin/npm /usr/local/bin/npm
|
|
ln -s $HOME/.nvm/versions/node/v8.12.0/bin/node /usr/local/bin/node
|
|
|
|
# environments manipulation
|
|
export NODE_PATH=$HOME.nvm/versions/node/v8.12.0/lib/node_modules
|
|
export PATH=$NODE_PATH:$PATH
|
|
|
|
# install default dependencies
|
|
npm config set PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors
|
|
npm install puppeteer -g --unsafe-perm=true
|
|
npm install puppeteer-core puppeteer-chromium-resolver crawlab-sdk -g --ignore-scripts
|