Ordres per instal·lar Node.js 17 sense preguntes, desinstal·lar-lo i detectar-lo des d’eines de desplegament. Només es mostra una ordre quan és segura: la que indica el manifest o el valor per defecte documentat de la tecnologia de l’instal·lador.
Guia relacionada: Instal·lació silenciosa: MSI, NSIS, Inno Setup · Desinstal·lar un programa amb el registre o PowerShell
Amb winget
PowerShell
winget install --id OpenJS.NodeJS.17 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id OpenJS.NodeJS.17 -e --silentwinget uninstall --id OpenJS.NodeJS.17 -e --silentPer instal·lador
64 bits · MSI · Tots els usuaris
Instal·lació silenciosa
msiexec /i node-v17.9.1-x64.msi /qn /norestartDesar un registre
msiexec /i node-v17.9.1-x64.msi /qn /norestart /l*v "%TEMP%\node-js-17-install.log"Desinstal·lar
msiexec /x {E25AFF60-6DB3-41D7-A310-15E822DD0E7B} /qn /norestart- Codi de producte MSI
- {E25AFF60-6DB3-41D7-A310-15E822DD0E7B}
- Clau de desinstal·lació al registre
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E25AFF60-6DB3-41D7-A310-15E822DD0E7B}
64 bits · ZIP
No cal instal·lar-lo (portable)
32 bits · MSI · Tots els usuaris
Instal·lació silenciosa
msiexec /i node-v17.9.1-x86.msi /qn /norestartDesar un registre
msiexec /i node-v17.9.1-x86.msi /qn /norestart /l*v "%TEMP%\node-js-17-install.log"Desinstal·lar
msiexec /x {B9C385CF-63B2-4753-85C5-061903033C53} /qn /norestart- Codi de producte MSI
- {B9C385CF-63B2-4753-85C5-061903033C53}
- Clau de desinstal·lació al registre
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{B9C385CF-63B2-4753-85C5-061903033C53}
32 bits · ZIP
No cal instal·lar-lo (portable)
PowerShell: baixar, verificar, instal·lar
Baixa el fitxer oficial, en comprova l’SHA256 i l’instal·la en mode silenciós.
install-node-js-17.ps1
$url = 'https://nodejs.org/dist/v17.9.1/node-v17.9.1-x64.msi'
$sha256 = '56A2AB389460C1E88A32B5A7128414FBF6DA89037D1218AFDA366638D6B6A0F1'
$file = Join-Path $env:TEMP 'node-v17.9.1-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-17.ps1
$url = 'https://nodejs.org/dist/v17.9.1/node-v17.9.1-x86.msi'
$sha256 = '5E59C8B4A3A32E9D8570DCACF47AC9606E7CEA106EB6087E6498F855AB65BAA3'
$file = Join-Path $env:TEMP 'node-v17.9.1-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