next-on-pages@1 Error: spawn yarn ENOENT
# pages-help
b
I have to build another module in another folder, so my build command looks something like this
cd xxx ; npx yarn install --frozen-lockfile; npm run build ; cd ../website ; npx yarn install --frozen-lockfile ; npx @cloudflare/next-on-pages@1
However, the next-on-pages script fails:
Copy code
14:00:27.200    ⚡️ @cloudflare/next-on-pages CLI v.1.0.0
14:00:27.221    node:events:491
14:00:27.221          throw er; // Unhandled 'error' event
14:00:27.221          ^
14:00:27.221    
14:00:27.222    Error: spawn yarn ENOENT
14:00:27.222        at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
14:00:27.222        at onErrorNT (node:internal/child_process:485:16)
14:00:27.222        at processTicksAndRejections (node:internal/process/task_queues:83:21)
14:00:27.222    Emitted 'error' event on ChildProcess instance at:
14:00:27.222        at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
14:00:27.223        at onErrorNT (node:internal/child_process:485:16)
14:00:27.223        at processTicksAndRejections (node:internal/process/task_queues:83:21) {
14:00:27.223      errno: -2,
14:00:27.223      code: 'ENOENT',
14:00:27.223      syscall: 'spawn yarn',
14:00:27.223      path: 'yarn',
14:00:27.223      spawnargs: [ '-v' ]
14:00:27.223    }
14:00:27.268    Failed: build command exited with code: 1
14:00:28.091    Failed: error occurred while running build comman
However if I run it with just
next-on-pages
it will work. I've also tested removing the last install command
Copy code
Executing user command: cd ./website ; npx @cloudflare/next-on-pages@1
15:21:33.383    npm WARN exec The following package was not found and will be installed: @cloudflare/next-on-pages@1.0.0
15:21:48.533    npm WARN deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
15:21:48.624    npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
15:21:50.456    npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
15:21:57.127    ⚡️ @cloudflare/next-on-pages CLI v.1.0.0
15:21:57.147    node:events:491
15:21:57.148          throw er; // Unhandled 'error' event
15:21:57.148          ^
15:21:57.148    
15:21:57.148    Error: spawn yarn ENOENT
15:21:57.148        at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
15:21:57.148        at onErrorNT (node:internal/child_process:485:16)
15:21:57.149        at processTicksAndRejections (node:internal/process/task_queues:83:21)
15:21:57.149    Emitted 'error' event on ChildProcess instance at:
15:21:57.149        at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
15:21:57.149        at onErrorNT (node:internal/child_process:485:16)
15:21:57.149        at processTicksAndRejections (node:internal/process/task_queues:83:21) {
15:21:57.149      errno: -2,
15:21:57.149      code: 'ENOENT',
15:21:57.149      syscall: 'spawn yarn',
15:21:57.150      path: 'yarn',
15:21:57.150      spawnargs: [ '-v' ]
15:21:57.150    }
15:21:57.187    Failed: build command exited with code: 1
15:21:57.950    Failed: error occurred while running build command
Fixed by installing yarn