Factsheet
How should I install Node JS?
node.js - Installing nodejs and npm on linux - Stack Overflow
[How-To] Install Node.js on Windows the Recommended Way : node
Trying to install node.js : SteamDeck
Videos
Per the Node.js website:
# Using Debian/Ubuntu
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
Then, you will have the latest version of Node.js.
If you're not a fan of curl <url> | bash -, or are using an unsupported distribution, you can try a manual installation.
Node is one of the easier projects to build. Just change the version as that continues to change.
Browse to http://nodejs.org/dist/latest/ to find out the latest package version.
cd /usr/local/src
wget http://nodejs.org/dist/latest/node-v7.2.1.tar.gz
tar -xvzf node-v7.2.1.tar.gz
cd node-v7.2.1
./configure
make
sudo make install
which node
You should see /usr/local/bin/node.
I'm rookie dev trying to install npm, and heard that I can get that by installing node JS. I went to the Node JS, however there are multiple options of downloading.
Should I install v23.5.0 (Current) or v22.12.0 (LTS)
Also, should I install it using fnm, docker, or chocolatey? For some reason it doesn't give me the option to select nvm or brew.
Any help would be appreciated
Edit: Theres also another option for x64, which is the prebuilt download option. Should I do that instead
I really recommend you install node and npm using nvm. This is the fastest, cleanest and easiest way to do it.
That way, you install NVM simply doing:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
To test that nvm was properly installed, close and re-open Terminal and enter nvm. If you get a nvm: command not found message, your OS may not have the necessary .bash_profile file. In Terminal, enter touch ~/.bash_profile and run the above install script again.
And you are now able to install node typing:
nvm install <version>
For example
nvm install 4.2.1
if you just want to install the latest node version, you can just type
nvm install node
In order to access node and npm as sudo (in order to have <1024 ports) you should run
n=$(which node)
n=${n%/bin/node}
chmod -R 755 $n/bin/*
sudo cp -r $n/{bin,lib,share} /usr/local
I wrote in the terminal the following command lines I hope it is useful for the community.
$ sudo apt install nodejs
$ curl -L https://npmjs.org/install.sh | sudo sh
good luck!