Open kmsomebody opened 6 months ago
Same issue
I figured out, using the home directory in WSL works, but not the windows drives. And node/npm need to be installed via WSL too, otherwise Windows is using the Windows installation.
I was having this problem when executing npm run preview which executes npm run pages:build && wrangler pages dev. For a moment I forked this project and used cross-spawn which solved a lot of problems executing commands on Windows via spawn. In addition, I added cross-env so that the setting of environment variables in the NPM scripts worked and then used shx so that the Linux commands rm -rf and cp worked as well.
However, I ran into further issues where it was trying to execute a bash shell and failing which I believe was related to package-manager-manager trying to execute npx. To get around this I executed npm run preview using Git Bash which then worked but ultimately lead me to another error which looks to be the fault of the Vercel CLI.
By all means, I am a huge Linux fan but my current development machine is running Windows. I know I could use WSL or perhaps create a VirtualBox VM running Linux but ideally I'd like everything to work natively on my current OS for performance reasons. I'm sure at some point the Vercel CLI will get better on Windows but for now it's definitely a non-starter.
Hopefully this information is helpful. Cheers.
Same issue please look into this
Still running on this issue with version 1.11.3
I replaced Windows with Linux on my development machine and the problem disappeared. Linux FTW
@danieleagle ikr this issue is only with windows.
Bun worked for me. Just run bunx @cloudflare/next-on-pages
as admin
next-on-pages environment related information
Description
The command
npx @cloudflare/next-on-pages
fails with the following error:This may or may not be related, but the command fails on both Powershell and WSL with a different error since 1.7.0:
Reproduction
Run
npx @cloudflare/next-on-pages
on Windows with Git BashPages Deployment Method
None
Pages Deployment ID
No response
Additional Information
The happens since next-on-pages 1.7.0. I also tested this on 1.8.2. Version 1.6.3 is working fine.
There has been a similar issue in the past, which was fixed: https://github.com/cloudflare/next-on-pages/pull/96