Commands for installing Node.js 16 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.16 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id OpenJS.NodeJS.16 -e --silentwinget uninstall --id OpenJS.NodeJS.16 -e --silentBy installer
64-bit · MSI · All users
Silent install
msiexec /i node-v16.20.2-x64.msi /qn /norestartWrite a log
msiexec /i node-v16.20.2-x64.msi /qn /norestart /l*v "%TEMP%\node-js-16-install.log"Uninstall
msiexec /x {B574737B-3A23-4038-BBA2-DA4D608E1A9A} /qn /norestart- MSI product code
- {B574737B-3A23-4038-BBA2-DA4D608E1A9A}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B574737B-3A23-4038-BBA2-DA4D608E1A9A}
- Install folder
- %ProgramFiles%\nodejs
64-bit · ZIP
No installation needed (portable)
32-bit · MSI · All users
Silent install
msiexec /i node-v16.20.2-x86.msi /qn /norestartWrite a log
msiexec /i node-v16.20.2-x86.msi /qn /norestart /l*v "%TEMP%\node-js-16-install.log"Uninstall
msiexec /x {4911387B-59DD-4550-8FEB-AE0467428B94} /qn /norestart- MSI product code
- {4911387B-59DD-4550-8FEB-AE0467428B94}
- Uninstall registry key
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{4911387B-59DD-4550-8FEB-AE0467428B94}
- 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-16.ps1
$url = 'https://nodejs.org/dist/v16.20.2/node-v16.20.2-x64.msi'
$sha256 = '8F78F8CEA29743F9BFD4544B9C01106929E62E5211F019DD1F0A4B02916683D2'
$file = Join-Path $env:TEMP 'node-v16.20.2-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-16.ps1
$url = 'https://nodejs.org/dist/v16.20.2/node-v16.20.2-x86.msi'
$sha256 = '5CDABF8C2D117DA96F5238930DF6E06D18D30F2B21C1DD91F84FB1098422B74A'
$file = Join-Path $env:TEMP 'node-v16.20.2-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