volta icon indicating copy to clipboard operation
volta copied to clipboard

use zip to install volta ,node not works

Open misaya98 opened this issue 8 months ago • 4 comments
trafficstars

i use zip to install volta because msi needs admin on windows. then i got cannot find command node. Please ensure that xxx/volta is available on your Path.

misaya98 avatar Mar 17 '25 09:03 misaya98

use msi to install will get below files, but if you use zip you will only get 3 files volta, volta-shim and volta-migrate Image

misaya98 avatar Mar 17 '25 09:03 misaya98

Once you unzip the files, you'll need to run volta.exe setup, which will then create the rest of the files for you and I believe should also update your path!

chriskrycho avatar Mar 18 '25 22:03 chriskrycho

The function behaves different for Windows and Linux: https://github.com/volta-cli/volta/blob/a7384fa4fc7a0eca961032da4d962d94218b5868/crates/volta-core/src/shim.rs#L28

Hence, the shims are not created by volta.exe setup.

rettenbs avatar Apr 24 '25 12:04 rettenbs

My workaround:

  1. Download the .msi
  2. Use 7-zip to unzip the msi
  3. Rename the unzipped files, e.g. from voltaEXE to volta.exe or npmCMD to npm.cmd
  4. Use the renamed files instead of the content from the zip

rettenbs avatar Apr 24 '25 13:04 rettenbs

Hello everyone,

I just encountered the same problem today, trying to install volta without Admin rights just seems impossible because of the missing shims when simply unpacking and setting up with volta setup.

To fix the problem, I think that when detecting a windows environment while doing volta setup, a check to verify that the shims are present in the volta.exe folder should be performed. If the shim files are missing, they are then created along the volta.exe, just like the installer does.

Ev3rdown avatar Jul 01 '25 14:07 Ev3rdown

I have confirmed that if you place such a script in the ZIP file extraction destination and run it, you will get the same results as if you installed it using the installer.

https://gist.github.com/got4416/2d2ef93151a4a358900401ef44ea8e4c#file-volta-shim-setup-cmd

@echo off
pushd "%~dp0"
set VOLTA_SHIM_EXE=volta-shim.exe
set SHIM_BINARY=node,npm,npx,pnpm,yarn,yarnpkg
set SHIM_SCRIPT=npm,npx,pnpm,yarn,yarnpkg
if not exist %VOLTA_SHIM_EXE% (
    echo ERROR %VOLTA_SHIM_EXE% not found!
    echo.
    pause
    exit /b 1
)
for %%s in (%SHIM_BINARY%) do (
	echo create %%s.exe
	copy /y %VOLTA_SHIM_EXE% %%s.exe
)
for %%s in (%SHIM_SCRIPT%) do (
	echo create %%s.cmd
	(
		echo @echo off
		echo ^"^%%^~dpn0.exe^" ^%%^*
	)>%%s.cmd
)
popd
exit /b

got4416 avatar Jul 07 '25 13:07 got4416

I have confirmed that if you place such a script in the ZIP file extraction destination and run it, you will get the same results as if you installed it using the installer.

https://gist.github.com/got4416/2d2ef93151a4a358900401ef44ea8e4c#file-volta-shim-setup-cmd

@echo off pushd "%~dp0" set VOLTA_SHIM_EXE=volta-shim.exe set SHIM_BINARY=node,npm,npx,pnpm,yarn,yarnpkg set SHIM_SCRIPT=npm,npx,pnpm,yarn,yarnpkg if not exist %VOLTA_SHIM_EXE% ( echo ERROR %VOLTA_SHIM_EXE% not found! echo. pause exit /b 1 ) for %%s in (%SHIM_BINARY%) do ( echo create %%s.exe copy /y %VOLTA_SHIM_EXE% %%s.exe ) for %%s in (%SHIM_SCRIPT%) do ( echo create %%s.cmd ( echo @echo off echo ^"^%%^~dpn0.exe^" ^%%^* )>%%s.cmd ) popd exit /b

works for me, thank you bro

misaya98 avatar Jul 11 '25 10:07 misaya98