Last active
August 31, 2023 17:11
-
-
Save fraserxu/23c2704cffa5a4cde79e1a48c087eca4 to your computer and use it in GitHub Desktop.
setup nodenv on ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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