You can install using this msiexec, select the version that's most suitable for you in the link
msiexec.exe /a https://nodejs.org/dist/v8.3.0/node-v8.3.0-x64.msi /quiet
Answer from Kalana Demel on Stack OverflowVideos
You can install using this msiexec, select the version that's most suitable for you in the link
msiexec.exe /a https://nodejs.org/dist/v8.3.0/node-v8.3.0-x64.msi /quiet
I was running in the ServerCore windows container on Gitlab so the msiexec.exe did not work for me. However found another answer that did work over here from user Witcher: Docker + Node.js + Windows
The commands in the container that ended up working in my gitlab yml file before_script were:
Invoke-WebRequest 'https://nodejs.org/dist/v18.12.0/node-v18.12.0-win-x64.zip' OutFile 'C:/nodejs.zip'
Expand-Archive C:\nodejs.zip -DestinationPath C:\
Rename-Item "C:\\node-v18.12.0-win-x64" C:\nodejs
$Env:Path += ";C:\nodejs"
This is downloading the Zip file from Nodejs's site to the root of C, expanding the archive, and setting the nodejs path to the environment path variable so the "npm" command is recognized.
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!