Commands for installing Node.js 12 without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
PowerShell
winget install --id OpenJS.NodeJS.12 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id OpenJS.NodeJS.12 -e --silentwinget uninstall --id OpenJS.NodeJS.12 -e --silentBy installer
64-bit · MSI · All users
Silent install
msiexec /i node-v12.22.12-x64.msi /qn /norestartWrite a log
msiexec /i node-v12.22.12-x64.msi /qn /norestart /l*v "%TEMP%\node-js-12-install.log"Uninstall
msiexec /x {0F6E1F50-886C-4D6D-A9F3-C82282CEF46A} /qn /norestart- MSI product code
- {0F6E1F50-886C-4D6D-A9F3-C82282CEF46A}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0F6E1F50-886C-4D6D-A9F3-C82282CEF46A}
- Install folder
- %ProgramFiles%\nodejs
64-bit · ZIP
No installation needed (portable)
32-bit · MSI · All users
Silent install
msiexec /i node-v12.22.12-x86.msi /qn /norestartWrite a log
msiexec /i node-v12.22.12-x86.msi /qn /norestart /l*v "%TEMP%\node-js-12-install.log"Uninstall
msiexec /x {FC40B728-3D24-4B80-B058-2DF08AAD9521} /qn /norestart- MSI product code
- {FC40B728-3D24-4B80-B058-2DF08AAD9521}
- Uninstall registry key
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{FC40B728-3D24-4B80-B058-2DF08AAD9521}
- Install folder
- %ProgramFiles(x86)%\nodejs
32-bit · ZIP
No installation needed (portable)
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-node-js-12.ps1
$url = 'https://nodejs.org/dist/v12.22.12/node-v12.22.12-x64.msi'
$sha256 = '76102997F9084E1FAA544693AD1DAEEF68394D46AE7E363AD8DF1FA86896133F'
$file = Join-Path $env:TEMP 'node-v12.22.12-x64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait install-node-js-12.ps1
$url = 'https://nodejs.org/dist/v12.22.12/node-v12.22.12-x86.msi'
$sha256 = '68A5F1198CF76B85CA9EB8819C1E3FA670AF6440534F59D920D267EA3CC0F402'
$file = Join-Path $env:TEMP 'node-v12.22.12-x86.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait