srcbookdev / srcbook

TypeScript-centric app development platform
https://srcbook.com
Apache License 2.0
2.58k stars 101 forks source link

More robust process handling for apps #418

Closed benjreinhart closed 4 weeks ago

benjreinhart commented 1 month ago

This PR:

TODO

The following still needs to be addressed but will do so in subsequent PR(s)

benjreinhart commented 4 weeks ago

Here is one instance of npm install failing:

792 info run esbuild@0.21.5 postinstall node_modules/esbuild node install.js
793 info run esbuild@0.21.5 postinstall { code: 1, signal: null }
794 verbose stack Error: command failed
794 verbose stack     at ChildProcess.<anonymous> (/Users/ben/.nvm/versions/node/v22.1.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
794 verbose stack     at ChildProcess.emit (node:events:520:28)
794 verbose stack     at maybeClose (node:internal/child_process:1105:16)
794 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
795 verbose pkgid esbuild@0.21.5
796 verbose cwd /Users/ben/.srcbook/apps/ucubf5g149koikd6a5ohthnvnc
797 verbose Darwin 23.5.0
798 verbose node v22.1.0
799 verbose npm  v10.7.0
800 error code 1
801 error path /Users/ben/.srcbook/apps/ucubf5g149koikd6a5ohthnvnc/node_modules/esbuild
802 error command failed
803 error command sh -c node install.js
804 error node:internal/errors:984
804 error   const err = new Error(message);
804 error               ^
804 error
804 error Error: Command failed: /Users/ben/.nvm/versions/node/v22.1.0/bin/node /Users/ben/.srcbook/apps/ucubf5g149koikd6a5ohthnvnc/node_modules/esbuild/bin/esbuild --version
804 error /Users/ben/.srcbook/apps/ucubf5g149koikd6a5ohthnvnc/node_modules/esbuild/bin/esbuild:1
804 error ����^L
804 error
804 error
804 error SyntaxError: Invalid or unexpected token
804 error     at wrapSafe (node:internal/modules/cjs/loader:1389:18)
804 error     at Module._compile (node:internal/modules/cjs/loader:1425:20)
804 error     at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
804 error     at Module.load (node:internal/modules/cjs/loader:1287:32)
804 error     at Module._load (node:internal/modules/cjs/loader:1103:12)
804 error     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:168:12)
804 error     at node:internal/main/run_main_module:30:49
804 error
804 error Node.js v22.1.0
804 error
804 error     at genericNodeError (node:internal/errors:984:15)
804 error     at wrappedFn (node:internal/errors:538:14)
804 error     at checkExecSyncError (node:child_process:889:11)
804 error     at Object.execFileSync (node:child_process:925:15)
804 error     at validateBinaryVersion (/Users/ben/.srcbook/apps/ucubf5g149koikd6a5ohthnvnc/node_modules/esbuild/install.js:99:28)
804 error     at /Users/ben/.srcbook/apps/ucubf5g149koikd6a5ohthnvnc/node_modules/esbuild/install.js:281:5 {
804 error   status: 1,
804 error   signal: null,
804 error   output: [
804 error     null,
804 error     Buffer(0) [Uint8Array] [],
804 error     Buffer(623) [Uint8Array] [
804 error        47,  85, 115, 101, 114, 115,  47,  98, 101, 110,  47,  46,
804 error       115, 114,  99,  98, 111, 111, 107,  47,  97, 112, 112, 115,
804 error        47, 117,  99, 117,  98, 102,  53, 103,  49,  52,  57, 107,
804 error       111, 105, 107, 100,  54,  97,  53, 111, 104, 116, 104, 110,
804 error       118, 110,  99,  47, 110, 111, 100, 101,  95, 109, 111, 100,
804 error       117, 108, 101, 115,  47, 101, 115,  98, 117, 105, 108, 100,
804 error        47,  98, 105, 110,  47, 101, 115,  98, 117, 105, 108, 100,
804 error        58,  49,  10, 239, 191, 189, 239, 191, 189, 239, 191, 189,
804 error       239, 191, 189,  12,
804 error       ... 523 more items
804 error     ]
804 error   ],
804 error   pid: 98013,
804 error   stdout: Buffer(0) [Uint8Array] [],
804 error   stderr: Buffer(623) [Uint8Array] [
804 error      47,  85, 115, 101, 114, 115,  47,  98, 101, 110,  47,  46,
804 error     115, 114,  99,  98, 111, 111, 107,  47,  97, 112, 112, 115,
804 error      47, 117,  99, 117,  98, 102,  53, 103,  49,  52,  57, 107,
804 error     111, 105, 107, 100,  54,  97,  53, 111, 104, 116, 104, 110,
804 error     118, 110,  99,  47, 110, 111, 100, 101,  95, 109, 111, 100,
804 error     117, 108, 101, 115,  47, 101, 115,  98, 117, 105, 108, 100,
804 error      47,  98, 105, 110,  47, 101, 115,  98, 117, 105, 108, 100,
804 error      58,  49,  10, 239, 191, 189, 239, 191, 189, 239, 191, 189,
804 error     239, 191, 189,  12,
804 error     ... 523 more items
804 error   ]
804 error }
804 error
804 error Node.js v22.1.0
805 verbose exit 1