Hopefully this isn't wildly inappropriate, as I am not experienced with node.js. I thought creating a new node.js app might be an easy way to try it out, and Google Puppeteer documentation here looked simple enough:
https://developers.google.com/web/tools/puppeteer/get-started
However, when I create the example files (both example.js
and hn.js
) I get the following error:
$ node hn.js
(node:248364) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
[0205/082632.633111:FATAL:zygote_host_impl_linux.cc(117)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/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 0x55cc81419ea9 base::debug::CollectStackTrace()
#1 0x55cc81381163 base::debug::StackTrace::StackTrace()
#2 0x55cc81394440 logging::LogMessage::~LogMessage()
#3 0x55cc7f48b7ab content::ZygoteHostImpl::Init()
#4 0x55cc80f2244a content::ContentMainRunnerImpl::Initialize()
#5 0x55cc80f1fea6 content::RunContentProcess()
#6 0x55cc80f20887 content::ContentMain()
#7 0x55cc80f7b79a headless::(anonymous namespace)::RunContentMain()
#8 0x55cc80f7b4a5 headless::HeadlessShellMain()
#9 0x55cc7dc5abbb ChromeMain
#10 0x7fe579b61555 __libc_start_main
#11 0x55cc7dc5a9ea _start
Received signal 6
#0 0x55cc81419ea9 base::debug::CollectStackTrace()
#1 0x55cc81381163 base::debug::StackTrace::StackTrace()
#2 0x55cc81419981 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7fe57e2de630 (/usr/lib64/libpthread-2.17.so+0xf62f)
#4 0x7fe579b75387 __GI_raise
#5 0x7fe579b76a78 __GI_abort
#6 0x55cc81418c15 base::debug::BreakDebuggerAsyncSafe()
#7 0x55cc8139486f logging::LogMessage::~LogMessage()
#8 0x55cc7f48b7ab content::ZygoteHostImpl::Init()
#9 0x55cc80f2244a content::ContentMainRunnerImpl::Initialize()
#10 0x55cc80f1fea6 content::RunContentProcess()
#11 0x55cc80f20887 content::ContentMain()
#12 0x55cc80f7b79a headless::(anonymous namespace)::RunContentMain()
#13 0x55cc80f7b4a5 headless::HeadlessShellMain()
#14 0x55cc7dc5abbb ChromeMain
#15 0x7fe579b61555 __libc_start_main
#16 0x55cc7dc5a9ea _start
r8: 0000000000000000 r9: 0000000000000300 r10: 0000000000000008 r11: 0000000000000206
r12: 00007ffc401286e0 r13: 00007ffc40127670 r14: 00007ffc401286f0 r15: aaaaaaaaaaaaaaaa
di: 000000000003ca48 si: 000000000003ca48 bp: 00007ffc40127660 bx: 00007ffc40127ea0
dx: 0000000000000006 ax: 0000000000000000 cx: ffffffffffffffff sp: 00007ffc40127528
ip: 00007fe579b75387 efl: 0000000000000206 cgf: aaaa000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/home/allsetadmin/apps/pupp/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:229:20)
at Interface.helper_js_1.helper.addEventListener (/home/allsetadmin/apps/pupp/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:219:68)
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)
(node:248364) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:248364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Is this an install issue with node.js, or headless Crome. or something else?