Windows: "'node' is not recognized as an internal or external command, operable program or batch file." in some postinstall scripts
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.
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/