volta icon indicating copy to clipboard operation
volta copied to clipboard

Windows: "'node' is not recognized as an internal or external command, operable program or batch file." in some postinstall scripts

Open Jinjiang opened this issue 1 year ago • 1 comments

Like when installing esbuild, the error 'node' is not recognized as an internal or external command, operable program or batch file. will be found during the postinstall script.

I've found after installing a Node.js via the official way on "C:\Program Files\nodejs", the error has gone. I guess in some cases the env vars of Volta doesn't work well?

Thanks.

Jinjiang avatar Aug 22 '24 23:08 Jinjiang

Same here, volta not working for postinstall

node_modules/dugite: Running postinstall script, failed in 53ms
node_modules/dugite postinstall$ node ./script/download-git.js
│ 'node' is not recognized as an internal or external command,
│ operable program or batch file.
└─ Failed in 53ms at xxx\node_modules\dugite

node is available in the powershell. But not in postinstall. volta setup not useful.


See https://docs.volta.sh/advanced/pnpm

And add C:\Program Files\Volta to PATH will make it work.

Not sure why it keeps adding this folder. I try to install Volta to I:\volta which is a dev drive https://learn.microsoft.com/en-us/windows/dev-drive/

linonetwo avatar Oct 09 '25 13:10 linonetwo