aw1875 / puppeteer-hcaptcha

A library to solve hcaptcha challenges that are automated within puppeteer. You can automatically set response values where they should be so the only thing left for you is submitting the page or you can get the response token.
https://www.npmjs.com/package/puppeteer-hcaptcha
137 stars 38 forks source link

[Bug]: Can't Install `puppeteer-hcaptcha` #60

Closed Errorbot1122 closed 2 years ago

Errorbot1122 commented 2 years ago

Describe the bug

A clear and concise description of what the bug is.

Everytime I try to install this package, it shows an error and cancels the install

To Reproduce

Steps to reproduce the behavior:

  1. Code block(s) with your code.
// Require puppeteer extra and puppeteer stealth
const puppeteer = require('puppeteer-extra')
const pluginStealth = require('puppeteer-extra-plugin-stealth')

// Require our hcaptcha method
const { hcaptcha } = require('puppeteer-hcaptcha');

// Tell puppeteer to use puppeteer stealth
puppeteer.use(pluginStealth());

(async () => {
  // Instantiate a new browser object
  // Ignore errors associated to https
  // Can be headless but for example sake we want to show the browser
  // Set your desired arguments for your puppeteer browser
  const browser = await puppeteer.launch({
    ignoreHTTPSErrors: true,
    headless: false,
    args: [
      `--window-size=600,1000`,
      "--window-position=000,000",
      "--disable-dev-shm-usage",
      "--no-sandbox",
      '--user-data-dir="/tmp/chromium"',
      "--disable-web-security",
      "--disable-features=site-per-process"
    ],
  });

  // Get browser pages
  const [page] = await browser.pages();

  // Send page to your url
  await page.goto('https://2captcha.com/demo/hcaptcha')

  // Remove the page's default timeout function
  await page.setDefaultNavigationTimeout(0);

  // Call hcaptcha method passing in our page
  await hcaptcha(page);

  // Your page is ready to submit. Captcha solving should be the last function on your page so we don't have to worry about the response token expiring.
  /**
   * Example:
   * await page.click("loginDiv > loginBtn");
   */
})();
  1. Description of your files hierarchy (either a photo or markdown).

image

  1. Any other steps needed to reproduce issue.
1. Open https://replit.com/@Kognise/Puppeteer-Template
2. Fork this by clicking the for button
3. Try and install this package using `npm i puppeteer-hcaptcha`
4. Chrome bug...

Screenshots

If applicable, add screenshots to help explain your problem.

image Screenshot 2022-05-24 11 12 29 AM image

Errors Received

If no screenshots available then please send the error received.

run-project
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'puppeteer-hcaptcha'
Require stack:
- /home/runner/Puppeteer-Test-1/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/runner/Puppeteer-Test-1/index.js:6:22)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/runner/Puppeteer-Test-1/index.js' ]
}
Makefile:4: recipe for target 'run' failed
make: *** [run] Error 1
exit status 2
~/Puppeteer-Test-1$ npm i puppeteer-hcaptcha
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

> @tensorflow/tfjs-node@3.18.0 install /home/runner/Puppeteer-Test-1/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-3.18.0.tar.gz
* Downloading libtensorflow
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.7.0.tar.gz
[========================      ] 8279291/bps 81% 2.2sevents.js:352
      throw er; // Unhandled 'error' event
      ^

Error: Unknown system error -122: Unknown system error -122, write
Emitted 'error' event on Unpack instance at:
    at Unpack.onerror (internal/streams/readable.js:745:14)
    at Unpack.emit (events.js:375:28)
    at Unpack.warn (/home/runner/Puppeteer-Test-1/node_modules/tar/lib/warn-mixin.js:7:12)
    at Unpack.[onError] (/home/runner/Puppeteer-Test-1/node_modules/tar/lib/unpack.js:325:12)
    at WriteStream.<anonymous> (/home/runner/Puppeteer-Test-1/node_modules/tar/lib/unpack.js:381:20)
    at WriteStream.emit (events.js:375:28)
    at WriteStream.[_onerror] (/home/runner/Puppeteer-Test-1/node_modules/tar/node_modules/fs-minipass/index.js:234:10)
    at WriteStream.[_onwrite] (/home/runner/Puppeteer-Test-1/node_modules/tar/node_modules/fs-minipass/index.js:296:21)
    at /home/runner/Puppeteer-Test-1/node_modules/tar/node_modules/fs-minipass/index.js:291:21
    at FSReqCallback.wrapper [as oncomplete] (fs.js:660:5) {
  errno: -122,
  code: 'Unknown system error -122',
  syscall: 'write'
}
npm WARN runner@1.0.0 No description
npm WARN runner@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tensorflow/tfjs-node@3.18.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @tensorflow/tfjs-node@3.18.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-05-24T18_37_21_281Z-debug.log

Additional context

Add any other context about the problem here.

I used to show a different error, but while trying to get the logs, the error changed (Old error was something to do with not being able to finish installing chrome or something...)

Errorbot1122 commented 2 years ago

I am currently forced to use version 3.0.6 as it was before it used Tensorflow

aw1875 commented 2 years ago

@ErrorBot1122 this seems like an issue related to TensorFlow and not this module. You may want to explore their issues section in their GitHub repo for answers (I recommend starting here). Unfortunately this isn't something I can fix as it's not related to my code at all so I will be closing this issue.