Error with @cloudflare/next-on-pages

Hi guys, trying to deploy a site with next and running into the following error when running npx @cloudflare/next-on-pages --experimental-minify:
@cloudflare/next-to-pages CLI
⚡️
⚡️ Installing 'vercel' CLI...
⚡️
node:events:491
throw er; // Unhandled 'error' event
^

Error: spawn npm ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'install', '-D', 'vercel' ]
}

Node.js v18.12.1
@cloudflare/next-to-pages CLI
⚡️
⚡️ Installing 'vercel' CLI...
⚡️
node:events:491
throw er; // Unhandled 'error' event
^

Error: spawn npm ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'install', '-D', 'vercel' ]
}

Node.js v18.12.1
4 Replies
James
James2y ago
Are you on Windows per chance?
James
James2y ago
It's a known issue with Windows at this time: https://github.com/cloudflare/next-on-pages/issues/52
GitHub
Error: spawn npm ENOENT · Issue #52 · cloudflare/next-on-pages
When trying to run npx @cloudflare/next-on-pages I get an error C:\Users......\project>npx @cloudflare/next-on-pages @cloudflare/next-to-pages CLI ⚡️ ⚡️ Installing 'vercel'...
salad
saladOP2y ago
Oh, ok. Yes... I am. So should I just push, and hope it doesn't happen on cloudflare?
James
James2y ago
You could try using wsl on windows to test Or trying out that PR that's linked in that issue - note that I've not tested that so do so at your own risk
Want results from more Discord servers?
Add your server