php icon indicating copy to clipboard operation
php copied to clipboard

Error during build (composer): Unknown system error -8

Open lhilton opened this issue 1 year ago • 5 comments

Bug report

  • Version: 0.7.3
  • URL: No
  • Repository: No
  • Node Version: v20
  • Host Machine: macOS 15.1

Description

Attempting to run vercel build against a fresh Laravel + Filament project and I am getting the following error:

> vercel build
Vercel CLI 39.0.5
Installing dependencies...

up to date in 201ms

44 packages are looking for funding
  run `npm fund` for details
Running "npm run build"

> build
> vite build

vite v5.4.10 building for production...
✓ 54 modules transformed.
public/build/manifest.json                0.45 kB │ gzip:  0.19 kB
public/build/assets/app-CPyPE_1i.css     58.71 kB │ gzip:  9.68 kB
public/build/assets/theme-B2T0CjxR.css  110.15 kB │ gzip: 15.46 kB
public/build/assets/app-z-Rg4TxU.js      35.05 kB │ gzip: 14.06 kB
✓ built in 736ms
🐘 Downloading user files
🐘 Downloading PHP runtime files
🐘 Installing Composer dependencies [START]
Error: spawn Unknown system error -8
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:761:9)
    at /Users/leezilla/sites/membership-platform/.vercel/builders/node_modules/vercel-php/dist/utils.js:173:49
    at new Promise (<anonymous>)
    at spawnAsync (/Users/leezilla/sites/membership-platform/.vercel/builders/node_modules/vercel-php/dist/utils.js:172:12)
    at runPhp (/Users/leezilla/sites/membership-platform/.vercel/builders/node_modules/vercel-php/dist/utils.js:153:15)
    at runComposerInstall (/Users/leezilla/sites/membership-platform/.vercel/builders/node_modules/vercel-php/dist/utils.js:94:11)
    at Object.build (/Users/leezilla/sites/membership-platform/.vercel/builders/node_modules/vercel-php/dist/index.js:43:46)
    at async doBuild (/Users/leezilla/.local/share/nvm/v20.8.1/lib/node_modules/vercel/dist/index.js:123379:23)
    at async main2 (/Users/leezilla/.local/share/nvm/v20.8.1/lib/node_modules/vercel/dist/index.js:123185:5) {
  errno: -8,
  code: 'Unknown system error -8',
  syscall: 'spawn'
}

In local development, composer runs fine and has no errors. I am able to track the full command run via the utils.js and have no problems manually running the composer command generated there. It appears that I cannot spawn the child process to run this.

lhilton avatar Nov 19 '24 19:11 lhilton

Hi, can you please describe your steps? It seems you are running it on your localhost?

f3l1x avatar Nov 20 '24 08:11 f3l1x

It is in my above message, in the output I provided. This is the result of running vercel build. Yes, localhost:

  • Version: 0.7.3
  • URL: No
  • Repository: No
  • Node Version: v20
  • Host Machine: macOS 15.1

lhilton avatar Nov 20 '24 21:11 lhilton

try changing your node version to 18 (I had issues with composer and changing the node version fixed it temporarely)

sordahl avatar Nov 22 '24 00:11 sordahl

@sordahl this did not change the error. It appears that this solution is setup to only use a Linux php binary source.

lhilton avatar Nov 24 '24 22:11 lhilton

Oh I get it now, I was not aware of vercel build command, now I am. vercel-php is not prepared to be build on your machine, thus it do not work.

f3l1x avatar Nov 26 '24 07:11 f3l1x