Ordres per instal·lar Node.js 12 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.12 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id OpenJS.NodeJS.12 -e --silentwinget uninstall --id OpenJS.NodeJS.12 -e --silentPer instal·lador
64 bits · MSI · Tots els usuaris
Instal·lació silenciosa
msiexec /i node-v12.22.12-x64.msi /qn /norestartDesar un registre
msiexec /i node-v12.22.12-x64.msi /qn /norestart /l*v "%TEMP%\node-js-12-install.log"Desinstal·lar
msiexec /x {0F6E1F50-886C-4D6D-A9F3-C82282CEF46A} /qn /norestart- Codi de producte MSI
- {0F6E1F50-886C-4D6D-A9F3-C82282CEF46A}
- Clau de desinstal·lació al registre
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0F6E1F50-886C-4D6D-A9F3-C82282CEF46A}
- 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-v12.22.12-x86.msi /qn /norestartDesar un registre
msiexec /i node-v12.22.12-x86.msi /qn /norestart /l*v "%TEMP%\node-js-12-install.log"Desinstal·lar
msiexec /x {FC40B728-3D24-4B80-B058-2DF08AAD9521} /qn /norestart- Codi de producte MSI
- {FC40B728-3D24-4B80-B058-2DF08AAD9521}
- Clau de desinstal·lació al registre
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{FC40B728-3D24-4B80-B058-2DF08AAD9521}
- 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-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