大佬教程收集整理的这篇文章主要介绍了npm start 未检测到 chrome 并返回 ENOENT 错误(ARCH Linux),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用 manjaro 并从 AUR 包下载了 Google-Chrome-stable。即使Google Chrome被设置为默认浏览器,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' ]
}
React 使用 BROWSER
环境变量来决定要使用的浏览器。尝试按如下方式运行您的 React 应用:
BROWSER=/usr/bin/google-chrome-stable npm start
如果这一切正常,您可以在这些情况下通过添加将 Chrome 设置为默认设置
export BROWSER=/usr/bin/google-chrome-stable
到您的终端配置文件(~/.zshrc
,如果您使用的是 zsh)。
以上是大佬教程为你收集整理的npm start 未检测到 chrome 并返回 ENOENT 错误(ARCH Linux)全部内容,希望文章能够帮你解决npm start 未检测到 chrome 并返回 ENOENT 错误(ARCH Linux)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。