Lenni
Lenni
DDeno
Created by Lenni on 2/28/2025 in #help
Install Deno globally for all users on a Windows 11 machine
I did it this way now in my Batch script. Not the prettiest solution, but it works.
set "newNpmPrefix=C:\npm"
powershell -command "[System.Environment]::SetEnvironmentVariable('Path', $env:Path + ';%newNpmPrefix%', [System.EnvironmentVariableTarget]::Machine)"

winget install OpenJS.NodeJS.LTS --silent --disable-interactivity --scope machine --architecture x64 --accept-source-agreements --accept-package-agreements

powershell -command "$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine'); npm i -g deno --prefix %newNpmPrefix%"
set "newNpmPrefix=C:\npm"
powershell -command "[System.Environment]::SetEnvironmentVariable('Path', $env:Path + ';%newNpmPrefix%', [System.EnvironmentVariableTarget]::Machine)"

winget install OpenJS.NodeJS.LTS --silent --disable-interactivity --scope machine --architecture x64 --accept-source-agreements --accept-package-agreements

powershell -command "$env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine'); npm i -g deno --prefix %newNpmPrefix%"
2 replies