运行命令yarn start时出现Chrome错误

时间:2020-04-21 18:32:02

标签: node.js npm yarnpkg

我不知道此git repo中使用的技术,只是尝试遵循创建者在https://github.com/paulmaunders/delivery-slot-bot上给出的步骤

我有一台Windows计算机,并安装了VMware Player,然后安装了Kali。下载了回购协议,并在kali中安装了NPM。当我运行命令“ Yarn Start”时,出现以下错误。我下载了chrome并安装了,但没有任何乐趣。任何建议如何解决此问题将不胜感激。 我曾经使用过Kali,所以对Linux有一些了解,但无法弄清楚这一点。

预先感谢


kali@kali:~/Downloads/delivery-slot-bot-master/delivery-slot-bot$ yarn start
yarn run v1.22.4
$ node ./src/index.js
index.js

Runs one-off

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Error: Failed to launch chrome!
[0421/142758.038038:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
#0 0x564e68efe879 base::debug::CollectStackTrace()
#1 0x564e68e5bc63 base::debug::StackTrace::StackTrace()
#2 0x564e68e70013 logging::LogMessage::~LogMessage()
#3 0x564e6a60a95e service_manager::ZygoteHostImpl::Init()
#4 0x564e68a9fadc content::ContentMainRunnerImpl::Initialize()
#5 0x564e68aeb72c service_manager::Main()
#6 0x564e68a9e0b1 content::ContentMain()
#7 0x564e68aea99d headless::(anonymous namespace)::RunContentMain()
#8 0x564e68aea70b headless::HeadlessShellMain()
#9 0x564e6687b1b8 ChromeMain
#10 0x7f92b55efbbb __libc_start_main
#11 0x564e6687b02a _start

Received signal 6
#0 0x564e68efe879 base::debug::CollectStackTrace()
#1 0x564e68e5bc63 base::debug::StackTrace::StackTrace()
#2 0x564e68efe401 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7f92b7a76520 <unknown>
#4 0x7f92b5603081 gsignal
#5 0x7f92b55ee535 abort
#6 0x564e68efd265 base::debug::BreakDebugger()
#7 0x564e68e70461 logging::LogMessage::~LogMessage()
#8 0x564e6a60a95e service_manager::ZygoteHostImpl::Init()
#9 0x564e68a9fadc content::ContentMainRunnerImpl::Initialize()
#10 0x564e68aeb72c service_manager::Main()
#11 0x564e68a9e0b1 content::ContentMain()
#12 0x564e68aea99d headless::(anonymous namespace)::RunContentMain()
#13 0x564e68aea70b headless::HeadlessShellMain()
#14 0x564e6687b1b8 ChromeMain
#15 0x7f92b55efbbb __libc_start_main
#16 0x564e6687b02a _start
  r8: 0000000000000000  r9: 00007ffde55c0d60 r10: 0000000000000008 r11: 0000000000000246
 r12: 00007ffde55c2028 r13: 00007ffde55c1008 r14: 00007ffde55c1008 r15: 00007ffde55c1020
  di: 0000000000000002  si: 00007ffde55c0d60  bp: 00007ffde55c0fb0  bx: 00007f92b5783840
  dx: 0000000000000000  ax: 0000000000000000  cx: 00007f92b5603081  sp: 00007ffde55c0d60
  ip: 00007f92b5603081 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/home/kali/Downloads/delivery-slot-bot-master/delivery-slot-bot/node_modules/puppeteer/lib/Launcher.js:348:14)
    at Interface.helper.addEventListener (/home/kali/Downloads/delivery-slot-bot-master/delivery-slot-bot/node_modules/puppeteer/lib/Launcher.js:337:50)
    at Interface.emit (events.js:203:15)
    at Interface.close (readline.js:397:8)
    at Socket.onend (readline.js:173:10)
    at Socket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentat

有关此命令的信息。

1 个答案:

答案 0 :(得分:0)

kali的问题在于,您以root用户身份登录的所有内容以及您执行的所有内容也将以root用户身份运行。但是chrome知道,以root身份运行它不是一个好主意,因此对您说不。

如错误消息所述,您可以将--no-sandbox添加到启动选项并使其以root用户身份运行。但是,这不是一个好主意。通常,运行非系统应用程序或流程(包括带有图形的应用程序或流程)不是一个好主意。

最好切换到非root帐户并在那里进行所有Web开发,或者只是切换到Ubuntu等普通发行版。