Skip to content

Instantly share code, notes, and snippets.

@xsenechal
Forked from fraserxu/install_git.sh
Created October 30, 2020 11:06
Show Gist options
  • Save xsenechal/7c998dff96b943d0324f12f5fe403bbe to your computer and use it in GitHub Desktop.
Save xsenechal/7c998dff96b943d0324f12f5fe403bbe to your computer and use it in GitHub Desktop.
setup nodenv on ubuntu
#!/bin/bash
set -ex
sudo apt-get update
sudo apt-get install -y git
#!/bin/bash
set -ex
NODENV_ROOT="~/.nodenv"
# check code from github
git clone https://github.com/nodenv/nodenv.git $NODENV_ROOT
git clone https://github.com/nodenv/node-build.git "$NODENV_ROOT"/plugins/node-build
# compile dynamic bash extension
cd $NODENV_ROOT && src/configure && make -C src
# for ubuntu
echo 'export PATH="$NODENV_ROOT/bin:$PATH"' >> ~/.bashrc
# Add nodenv init to your shell to enable shims and autocompletion.
echo 'eval "$(nodenv init -)"' >> ~/.bashrc
# need to restart the shell and check nodenv is installed
# type nodenv
#!/bin/bash
set -ex
NODENV_ROOT="~/.nodenv"
git clone https://github.com/nodenv/node-build.git "$NODENV_ROOT"/plugins/node-build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment