Skip to content

Instantly share code, notes, and snippets.

@fraserxu
Last active August 31, 2023 17:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save fraserxu/23c2704cffa5a4cde79e1a48c087eca4 to your computer and use it in GitHub Desktop.
Save fraserxu/23c2704cffa5a4cde79e1a48c087eca4 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