-
First install nodejs and npm.
sudo apt-get install nodejs npm -
Now clean the cache of npm first:
sudo npm cache clean -f -
Install n module of npm:
sudo npm install -g n -
Begin the installation by selecting the version of node to install: stable or latest or specific version number:
sudo n stableor
sudo n 12.18.2Current LTS version
sudo n 16.15.1 -
Check the version of node:
node -v -
Check the version of npm:
npm -v
Last active
October 18, 2024 15:42
-
-
Save farhad0085/13c13ff61236aab04672ec1f8fa366ed to your computer and use it in GitHub Desktop.
This is going to be beyond the scope of the tutorial. However here is how you could install a specific version if needed:
First, install the required libraries:
sudo apt-get install libssl-dev openssl make gcc
Then choose the specific Python from here:
https://www.python.org/ftp/python/
After that go to the /opt directory and download the archive of the specific version:
cd /opt
wget https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz
Extract the archive:
tar xzvf Python-3.9.2.tgz
Then cd into the directory:
cd Python-3.9.2
And finally, compile the new version:
./configure --enable-optimizations
make
make install
Finally you can create a symlink for that specific Python version so that you could use the binary from anywhere:
sudo ln -fs /opt/Python-3.9.2/Python /usr/bin/python3.9
Then you could check if the python3.9 version is available:
python3.9 --version
sudo apt purge -y python2.7-minimal
sudo apt purge -y python2.*
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo apt install -y python3-pip
sudo ln -s /usr/bin/pip3 /usr/bin/pip
python --version
Reference: https://stackoverflow.com/a/60590067
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment