0xhjohnson / captcha-harvester

Node cli to casually harvest captchas from supremenewyork and others

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crashes immediately when trying to compile with PKG to an executable

Joiubaxas opened this issue · comments

I'm trying to compile this with pkg to an executable for easier use, but when compiling I get a warning.

Warning Cannot include directory %1 into executable.
The directory must be distributed with executable as %2.
node_modules\puppeteer.local-chromium
path-to-executable/puppeteer

Other people who use puppeteer in their node projects and try to compile them using pkg get them too but you can solve it by placing node_modules\puppeteer.local-chromium directory in the same directory as the executable and renaming it puppeteer.
But after doing that and trying to open the executable the terminal opens and it crashes instantly, so you can't even see the error log. It would be helpful if anyone could tell me how to fix this issue.

Was able to get error that is printed when opening the executable by opening it with command prompt.

(node:17308) UnhandledPromiseRejectionWarning: Error: Cannot find module 'puppeteer-extra-plugin-stealth/evasions/chrome.runtime'

  1. If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at Function.Module._resolveFilename (module.js:546:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1287:46)
    at Function.Module._load (module.js:473:25)
    at Module.require (module.js:595:17)
    at Module.require (pkg/prelude/bootstrap.js:1166:31)
    at require (internal/module.js:11:18)
    at PuppeteerExtra.resolvePluginDependencies (C:\snapshot\captcha-harvester-master\node_modules\puppeteer-extra\index.js:264:15)
    at PuppeteerExtra.launch (C:\snapshot\captcha-harvester-master\node_modules\puppeteer-extra\index.js:96:10)
    at J (C:\snapshot\captcha-harvester-master\bin\main.js:2:3315)
    at D (C:\snapshot\captcha-harvester-master\bin\main.js:2:4449)
    (node:17308) 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: 4)
    (node:17308) [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.

This project uses uses the puppeteer-extra package as a drop in replacement for puppeteer which is most likely the culprit. I will look into it this week.

Any update on this issue?

Haven't had much time to work on this issue but can confirm the stacktrace you posted above. Might have to submit an issue to https://github.com/berstend/puppeteer-extra as extra plugins are not included in compilation