oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.81k stars 2.73k forks source link

`bun create react-app` fails when npm isn't installed. #6318

Closed lwander closed 11 months ago

lwander commented 1 year ago

What version of Bun is running?

1.0.2

What platform is your computer?

Linux 6.2.0-33-generic x86_64 x86_64

What steps can reproduce the bug?

Run bun create react-app on a system without npm installed.

What is the expected behavior?

Return code 0 with working react-app scaffolding

What do you see instead?

$ bun create react-app demo

Creating a new React app in /home/lars/dev/viz/demo.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

Aborting installation.
Unexpected error. Please report it as a bug:
610 |   }
611 |   get stdio() {
612 |     return this.#stdioObject ??= this.#createStdioObject();
613 |   }
614 | 
615 |   spawn(options) {
                 ^
TypeError: Executable not found in $PATH: "npm"
 code: "ERR_INVALID_ARG_TYPE"

      at spawn (node:child_process:615:14)
      at node:child_process:2:40
      at spawn (/tmp/create-react-app@latest--bunx/node_modules/cross-spawn/index.js:12:20)
      at /tmp/create-react-app@latest--bunx/node_modules/create-react-app/createReactApp.js:383:18
      at new Promise (:1:20)
      at install (/tmp/create-react-app@latest--bunx/node_modules/create-react-app/createReactApp.js:334:9)
      at /tmp/create-react-app@latest--bunx/node_modules/create-react-app/createReactApp.js:461:15
      at processTicksAndRejections (:55:76)

Deleting generated file... package.json
Deleting demo/ from /home/lars/dev/viz
Done.
error: "create-react-app" exited with code 1 (SIGHUP)

Additional information

No response

LangLangBart commented 1 year ago

similar tickets

Electroid commented 11 months ago

Closing as duplicate of #5995