hacks/fix-raspian-defaults/root/boot/setup-scripts/20-install-nvm-and-node.sh

21 lines
372 B
Bash

export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y git
export HOME=/root
git clone https://github.com/creationix/nvm.git /root/.nvm
cat >> /root/.bashrc <<'EOF'
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
EOF
source /root/.bashrc
nvm install 10
nvm use 10
npm install -g npm@latest
npm install -g yarn