npm start react issue

Viewed 76

i have alawys use npm start to run a React application

these days i try to use this command i got an error

and it goes like this

ps: i'm using ubuntu 20.04


node:events:371
      throw er; // Unhandled 'error' event
      ^

Error: spawn brave 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 brave',
  path: 'brave',
  spawnargs: [ 'http://localhost:3000' ]
}

I have deleted the cache,

I did delete node_modules and run npm install

and still i face the same problem

and if i use sudo npm start everything works fine

1 Answers

I think you installed node with root permission, that we lead to restricting non-sudo to use global packages.

I suggest that you remove the current node installation, and use nvm instead to install the desired node version https://github.com/nvm-sh/nvm.

after that, you need to install react-create-app again.

Related