tar.gz from the Nodejs website, extract it to ~/nodejs, and the binaries that are available to you in your $PATH environment variable are automatically updated. I use zsh so I just updated a line in ~/.zshrc: export PATH="$HOME/bin/nodejs/bin:$PATH"Ĭlose your terminal and re-open, then type the following to check: $ node -vīy creating the sym link, it now means that in the future, you can download a new. This will check if the directory exists, and if it does, add it to your PATH. You want to add this to the bottom of that file (changing the path, if you did not use ~/bin/): # Set the node PATH if it exists Now you want to make sure that the bin folder containing the nodejs directory is in your $PATH environment variable, so open the ~/.profile file in your home directory. This will create a symlink from the nodejs folder in your home directory to the bin directory (meaning that any updates to the directory in your home folder are reflected in the folder elsewhere via the symbolic link). I used my home directory so it is only available to me, but you could also easily do: $ ln -s ~/nodejs /usr/local/bin/nodejs Obviously, this can go to any bin location you want. Then you want to create a symlink to one of your bin locations so that the binaries can be used from your shell without writing out the full path.Īssuming you put the nodejs folder in your home directory you can now do: $ ln -s ~/nodejs ~/bin/nodejs If you would like to be able to easily update your node version, then move the nodejs folder somewhere you can keep track of it ( ~/nodejs perhaps?). If you are not interested in keeping node updated, then simply move this folder into one of your bin locations (I use ~/bin), and skip the next step. Install Nodejs and NPM The npm is the package manager of NodeJs, run the below mentioned command to install NodeJs and npm on Debian 11: sudo apt install nodejs npm Check Version To verify the correct version installation of NodeJs, run the below mentioned command to check version number of recently installed NodeJs: node -v Output: v12.22. Now I would rename the folder to something a bit easier to keep track of $ mv node-v4.2.2-linux-圆4 nodejs If you have a look in the bin folder you will see the binaries you need for node and npm: $ ls node-v4.2.2-linux-圆4/bin tar.gz from their website and cd into that dir (the name of the file is obviously specific to my download): $ tar -xzvf node-v4.2.2-linux-圆4.tar.gz I have not had any problems doing this on Jessie.ĭownload the. This will also mean you have an updated version of npm. You can download the latest version of Node ( 4.2.2) from their website, instead of using the package Debian provides ( 0.12).
0 Comments
Leave a Reply. |