0

I was learning react and when I run 'npm start' command I got an error like this

node:events:371
  throw er; // Unhandled 'error' event
  ^                                                                             
Error: spawn firedragon ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:480:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)         
                                                                               
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:480:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
   errno: -2,
   code: 'ENOENT',
   syscall: 'spawn firedragon',
   path: 'firedragon',
   spawnargs: [ 'http://localhost:3000' ]
}

I actually removed firedragon which was a default browser of my os (garuda linux) I actually like to use opera browser and this error only started coming after I deleted firedragon browser

Please help me reach out of this problem

3 Answers 3

0

Assuming you have started with Create React App, you can use the BROWSER environment variable to specify a browser. By default, Create React App will use the default system browser.

In your case, you can try:

BROWSER=opera npm start

Refer https://create-react-app.dev/docs/advanced-configuration/ for more details.

Alternately, you can also try opening your preferred browser and setting it as the default system browser.

Sign up to request clarification or add additional context in comments.

Comments

0

What are you running? Is this a fresh create-react-app project or something you cloned? :)

1 Comment

0

When you do npm start, after the build, React tries to open the default browser to your application's url.

Check and change your default browser or, if you're using create-react-app, you can change the browser with environment variables by running

BROWSER=opera npm start

If you want, you can completly disable this behaviour at project level by adding .env file with

BROWSER=none

with this you have to manually open the browser after the build

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.