How to install Node.js in custom folder silently on Windows?
Asked Answered
I

4

14

I create a script to auto install all my dev stack on Windows.

I have a problem with Node.js

What's the command line to install node-v0.10.23-x64.msi in C:\Tools silently?

Thanks.

Impearl answered 14/12, 2013 at 14:5 Comment(0)
I
13

I found it.

This is the correct way to install Node.js on Windows silently in a custom directory.

msiexec.exe /i node-v0.10.23-x64.msi INSTALLDIR="C:\Tools\NodeJS" /quiet
Impearl answered 15/12, 2013 at 12:20 Comment(0)
I
8
msiexec.exe /i node-v0.10.23-x64.msi /qn
  • /i means normal install
  • /qn means no UI

I do not known how to set the destination, you can read documentation here, and check if msi supports it:

http://www.advancedinstaller.com/user-guide/msiexec.html

Irreproachable answered 14/12, 2013 at 14:39 Comment(2)
I already tried that but Node.js is not available from cmd (not in the PATH) after installation and I don't find how to specify a destination.Impearl
Can you specify TARGETDIR? Have you close cmd.exe and open it again?Irreproachable
G
4

This will do the exact installation as doing it manual from the UI

msiexec /i node-v6.11.2-x64.msi TARGETDIR="C:\Program Files\nodejs\" ADDLOCAL="NodePerfCtrSupport,NodeEtwSupport,DocumentationShortcuts,EnvironmentPathNode,EnvironmentPathNpmModules,npm,NodeRuntime,EnvironmentPath" /qn
Glynisglynn answered 1/3, 2018 at 18:45 Comment(1)
Thanks for getting the 'add to path' option included, I've been scouring for thatFrag
A
4

To expand a little on foozar's answer, which works.

msiexec.exe /i node-v0.10.23-x64.msi INSTALLDIR="C:\Tools\NodeJS" /quiet

Note that /quiet may be better replaced with /passive:

  • Passive shows the status bar, and more importantly, prompts the user for the admin password if needed.
  • Quiet mode will just fail if the installer doesn't have privileges.
Ayo answered 5/6, 2018 at 17:30 Comment(1)
/passive was exactly what I was looking for! Thank you.Fanatical

© 2022 - 2024 — McMap. All rights reserved.