Files
runner-images/images/linux/scripts/installers/nodejs.sh
T

30 lines
983 B
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2019-11-15 15:23:41 -05:00
################################################################################
## File: nodejs.sh
## Desc: Installs Node.js LTS and related tooling (Gulp, Grunt)
2019-11-15 15:23:41 -05:00
################################################################################
2021-02-26 20:06:24 +05:00
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
2021-10-30 14:56:36 +03:00
# Install default Node.js
defaultVersion=$(get_toolset_value '.node.default')
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o ~/n
bash ~/n $defaultVersion
2021-10-30 14:56:36 +03:00
2021-02-26 20:06:24 +05:00
# Install node modules
node_modules=$(get_toolset_value '.node_modules[].name')
npm install -g $node_modules
echo "Creating the symlink for [now] command to vercel CLI"
ln -s /usr/local/bin/vercel /usr/local/bin/now
# fix global modules installation as regular user
# related issue https://github.com/actions/virtual-environments/issues/3727
sudo chmod -R 777 /usr/local/lib/node_modules
sudo chmod -R 777 /usr/local/bin
2019-11-15 15:23:41 -05:00
rm -rf ~/n
2021-02-26 20:06:24 +05:00
invoke_tests "Node" "Node.js"