Ordres per instal·lar Node.js 18 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.18 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id OpenJS.NodeJS.18 -e --silentwinget uninstall --id OpenJS.NodeJS.18 -e --silentPer instal·lador
64 bits · MSI · Tots els usuaris
Instal·lació silenciosa
msiexec /i node-v18.20.8-x64.msi /qn /norestartDesar un registre
msiexec /i node-v18.20.8-x64.msi /qn /norestart /l*v "%TEMP%\node-js-18-install.log"Desinstal·lar
msiexec /x {CC48A89B-2866-40B4-8B58-3DEFB1F2643E} /qn /norestart- Codi de producte MSI
- {CC48A89B-2866-40B4-8B58-3DEFB1F2643E}
- Clau de desinstal·lació al registre
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CC48A89B-2866-40B4-8B58-3DEFB1F2643E}
- Carpeta d’instal·lació
- %ProgramFiles%\nodejs
64 bits · ZIP
No cal instal·lar-lo (portable)
32 bits · MSI · Tots els usuaris
Instal·lació silenciosa
msiexec /i node-v18.20.8-x86.msi /qn /norestartDesar un registre
msiexec /i node-v18.20.8-x86.msi /qn /norestart /l*v "%TEMP%\node-js-18-install.log"Desinstal·lar
msiexec /x {4035A1E1-3B32-4961-AD82-1D0E05AE5FD7} /qn /norestart- Codi de producte MSI
- {4035A1E1-3B32-4961-AD82-1D0E05AE5FD7}
- Clau de desinstal·lació al registre
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{4035A1E1-3B32-4961-AD82-1D0E05AE5FD7}
- Carpeta d’instal·lació
- %ProgramFiles(x86)%\nodejs
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-18.ps1
$url = 'https://nodejs.org/dist/v18.20.8/node-v18.20.8-x64.msi'
$sha256 = 'BD8B92343E12DBE9E573D2F5D5FEC6953FCF12E00ADD58A29A6774391D02F342'
$file = Join-Path $env:TEMP 'node-v18.20.8-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-18.ps1
$url = 'https://nodejs.org/dist/v18.20.8/node-v18.20.8-x86.msi'
$sha256 = 'C7A04A1378CB66F5716F2B67C65921497972E883541BC48C0B19C92668F1713D'
$file = Join-Path $env:TEMP 'node-v18.20.8-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