Description:
I tried to build the packages within the Eslint Rewrite. When using Node.js, npm run build functioned correctly on both Windows and macOS. However, when I used the command bun run --bun build on Windows, it performed as expected, whereas on macOS, I encountered the following error:
Building packages in this order: packages/object-schema, packages/config-array, packages/compat, packages/core, packages/migrate-config
Building packages/object-schema...
> @eslint/object-schema@2.1.4 build
> rollup -c && tsc -p tsconfig.esm.json && npm run build:cts
npm ERR! Lifecycle script `build` failed with error:
npm ERR! TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity)
npm ERR! in workspace: @eslint/object-schema@2.1.4
npm ERR! at location: /Users/amareshsm/Desktop/Repositories/rewrite/packages/object-schema
104 | function buildPackages(packageDirs) {
105 | console.log(`Building packages in this order: ${packageDirs.join(", ")}`);
106 |
107 | for (const packageDir of packageDirs) {
108 | console.log(`Building ${packageDir}...`);
109 | execSync(`npm run build -w ${packageDir} --if-present`, {
^
error: null
errno: -1
code: "1"
syscall: "spawnSync"
path: "/bin/sh"
at new SystemError (node:child_process:902:14)
at node:child_process:175:24
at node:child_process:226:23
at buildPackages (/Users/amareshsm/Desktop/Repositories/rewrite/scripts/build.js:109:3)
at /Users/amareshsm/Desktop/Repositories/rewrite/scripts/build.js:125:1
Bun v1.1.20 (macOS arm64)
error: script "build" exited with code 1
➜ rewrite git:(bun-test)
src/index.js → dist/cjs/index.cjs, dist/esm/index.js...
created dist/cjs/index.cjs, dist/esm/index.js in 44ms
> @eslint/object-schema@2.1.4 build:cts
> node -e "fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')"
npm ERR! Lifecycle script `build:cts` failed with error:
npm ERR! TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity)
npm ERR! in workspace: @eslint/object-schema@2.1.4
npm ERR! at location: /Users/amareshsm/Desktop/Repositories/rewrite/packages/object-schema
The packages should be built successfully without any errors.
What do you see instead?
Instead I got the below error:
$ node scripts/build.js
Building packages in this order: packages/object-schema, packages/config-array, packages/compat, packages/core, packages/migrate-config
Building packages/object-schema...
> @eslint/object-schema@2.1.4 build
> rollup -c && tsc -p tsconfig.esm.json && npm run build:cts
npm ERR! Lifecycle script `build` failed with error:
npm ERR! TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity)
npm ERR! in workspace: @eslint/object-schema@2.1.4
npm ERR! at location: /Users/amareshsm/Desktop/Repositories/rewrite/packages/object-schema
104 | function buildPackages(packageDirs) {
105 | console.log(`Building packages in this order: ${packageDirs.join(", ")}`);
106 |
107 | for (const packageDir of packageDirs) {
108 | console.log(`Building ${packageDir}...`);
109 | execSync(`npm run build -w ${packageDir} --if-present`, {
^
error: null
errno: -1
code: "1"
syscall: "spawnSync"
path: "/bin/sh"
at new SystemError (node:child_process:902:14)
at node:child_process:175:24
at node:child_process:226:23
at buildPackages (/Users/amareshsm/Desktop/Repositories/rewrite/scripts/build.js:109:3)
at /Users/amareshsm/Desktop/Repositories/rewrite/scripts/build.js:125:1
Bun v1.1.20 (macOS arm64)
error: script "build" exited with code 1
➜ rewrite git:(bun-test)
src/index.js → dist/cjs/index.cjs, dist/esm/index.js...
created dist/cjs/index.cjs, dist/esm/index.js in 44ms
> @eslint/object-schema@2.1.4 build:cts
> node -e "fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')"
npm ERR! Lifecycle script `build:cts` failed with error:
npm ERR! TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity)
npm ERR! in workspace: @eslint/object-schema@2.1.4
npm ERR! at location: /Users/amareshsm/Desktop/Repositories/rewrite/packages/object-schema
What version of Bun is running?
1.1.20+ae1948925
What platform is your computer?
Darwin 21.5.0 arm64 arm
What steps can reproduce the bug?
Description: I tried to build the packages within the Eslint Rewrite. When using Node.js,
npm run build
functioned correctly on both Windows and macOS. However, when I used the commandbun run --bun build
on Windows, it performed as expected, whereas on macOS, I encountered the following error:Steps:
npm install
bun run --bun build
What is the expected behavior?
The packages should be built successfully without any errors.
What do you see instead?
Instead I got the below error:
Additional information
It is failing in CI as well - https://github.com/eslint/rewrite/pull/87
When I used the
bun run --bun build
command to build each package individually, it worked as expected.