6

I am creating a package installer which has nodejs, redis, and socket.io as prerequisites. The problem is that I don't want the developers to install the prerequisites own their own.

I figured out a way of doing that using on mac and ubuntu by including brew install node for mac and sudo apt-get install nodejs, sudo apt-get install npm

I am now looking for a way to install nodejs on window using a command or two. Any Idea? Please.

Kamga Simo Junior
  • 1,679
  • 2
  • 16
  • 30
  • 1
    Uh - maybe write a shell script with the "apt-get install" (Linux) or curl/run (Windows) commands? Q: Why exactly *DON'T* you want "developers to install on their own"? Would a standard .bat file help insure a standard install? Q: Is this Windows (you said "windows"), or Linux (you also said "apt-get") or both? Q: What exactly are you trying to accomplish? – paulsm4 Aug 10 '17 at 00:19
  • 1
    I want a command to install nodejs on Windows OS – Kamga Simo Junior Aug 10 '17 at 00:22
  • Personally, I would just make the Node "setup" available to whoever needs to run it. If you really want a Windows equivalent to [linuxbrew](http://linuxbrew.sh/), then take a look at [scoop](http://scoop.sh/) – paulsm4 Aug 10 '17 at 00:31
  • scoop is good by it seems to require powershell 3 – Kamga Simo Junior Aug 10 '17 at 00:33
  • so the developer will need to download and install powershell 3 be getting started. This is bringing us back to the initial problem. – Kamga Simo Junior Aug 10 '17 at 00:35

5 Answers5

11

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
Kalana Demel
  • 3,220
  • 3
  • 21
  • 34
1

Nodejs Alternative For Windows

Using Chocolatey:

cinst nodejs

or for full install with npm

cinst nodejs.install

Using Scoop:

scoop install nodejs
  • Use `cinst nodejs.install -y` to accept all prompts. Also you can automatically install Chocolatey using this single command beforehand - `powershell -command "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"` – jrbe228 Apr 13 '22 at 05:21
1

You could use:

cinst nodejs.install

This is great install with npm.

1

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.

Khoward
  • 191
  • 1
  • 4
0

Install nodejs version 8.10.0 on window

  1. download the installer from the url given below

2.Install Angular 6 on window

  • Open command line as administrator
  • run below command in command line

    npm install -g @angular/cli@6