Arch Linux Manjaro: npm start가 크롬을 감지하지 못하고 ENOENT 오류를 반환합니다.

Arch Linux Manjaro: npm start가 크롬을 감지하지 못하고 ENOENT 오류를 반환합니다.

저는 Manjaro를 사용하고 있으며 AUR 패키지에서 google-chrome-stable을 다운로드했습니다. Google 크롬이 기본 브라우저로 설정되어 있어도 npm start는 여전히 Firefox를 여는 기본값으로 설정되어 있습니다. Firefox를 삭제한 후 다음 오류가 발생하기 시작합니다.

Starting the development server...

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

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

답변1

react-scripts툴체인으로 사용하는 경우 BROWSER환경 변수를 원하는 브라우저로 설정할 수 있습니다.

모든 프로젝트에서 작동하게 하려면 .bashrc파일을 편집하고 다음을 추가하세요.

export BROWSER=chrome

관련 정보