It feels like installing nodenv with anyevn and installing and managing the version of Node you want with nodenv
python
$ git clone https://github.com/riywo/anyenv ~/.anyenv
$ echo 'export PATH="~/.anyenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(anyenv init -)"' >> ~/.bash_profile
$ exec $SHELL -l
#Verification
$ anyenv -v
anyenv 1.1.1
#Initialize
$ anyenv install --init
python
$ anyenv install nodenv
$ echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bash_profile
$ exec $SHELL -l
#Verification
$ nodenv -v
nodenv 1.3.1+5.dd4534e
python
$ touch $(nodenv root)/default-packages
#Installable version check
$ nodenv install --list
#Installation
$ nodenv install 14.3.0
#Verification
$ node -v
v14.3.0
#installed at the same time as npm
$ npm -v
v6.14.5
#Set to global
#If set to global, node commands will always be executed in that version
$ nodenv global 12.13.0
#Check the installed version in the list
$ nodenv versions
#When setting another version locally
#You can set the version to be set locally for each directory.
#If you set local in the directory of a specific project, it will be executed in that version
$ nodenv local 12.12.0
python
$ anyenv install rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ exec $SHELL -l
#Verification
$ rbenv -v
rbenv 1.1.2-30-gc879cb0
python
#Version check to install
$ rbenv install --list
#Install the version you want
$ rbenv install 2.7.1
#Set to global
#If set to global, node commands will always be executed in that version
$ rbenv global 2.7.1
#Verification
$ rbenv versions
#When setting another version locally
#You can set the version to be set locally for each directory.
#If you set local in the directory of a specific project, it will be executed in that version
$ rbenv local 2.6.0
What to do if the following error occurs
python
$ rbenv install 2.7.1
Downloading ruby-2.7.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Installing ruby-2.7.1...
BUILD FAILED (Ubuntu 20.04 using ruby-build 20200520)
Inspect or clean up the working tree at /tmp/ruby-build.20200529010032.1915.2716Kv
Results logged to /tmp/ruby-build.20200529010032.1915.log
Last 10 log lines:
checking for ruby... false
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/ruby-build.20200529010032.1915.2716Kv/ruby-2.7.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
If you get an error, you may be able to solve it by running around here.
python
$ sudo apt-get update
$ sudo apt-get install -y build-essential checkinstall
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Same as above I haven't done it, but maybe I can go with the following feeling
python
$ anyenv install pyenv
$ echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
$ exec $SHELL -l
#Verification
$ pyenv -v
python
#Version check to install
$ pyenv install --list
#Install the version you want
$ pyenv install [version]
#Set to global
#If set to global, node commands will always be executed in that version
$ pyenv global [version]
#Verification
$ pyenv versions
#When setting another version locally
#You can set the version to be set locally for each directory.
#If you set local in the directory of a specific project, it will be executed in that version
$ pyenv local [version]
Recommended Posts