puppeteer-extra
puppeteer-extra copied to clipboard
Error: Cannot find module when package with pkg
I try to package the nodejs app with puppeteer extra but get the error:
Error: Cannot find module 'puppeteer-extra-plugin-stealth/evasions/chrome.runtime'
Require stack:
- /snapshot/project-name/node_modules/puppeteer-extra/dist/index.cjs.js
- /snapshot/project-name/browser.js
- /snapshot/project-name/index.js
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 (internal/modules/cjs/loader.js:974:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46)
at Function.Module._load (internal/modules/cjs/loader.js:857:27)
at Module.require (internal/modules/cjs/loader.js:1034:19)
at Module.require (pkg/prelude/bootstrap.js:1225:31)
at require (internal/modules/cjs/helpers.js:72:18)
at PuppeteerExtra.resolvePluginDependencies (/snapshot/project-name/node_modules/puppeteer-extra/dist/index.cjs.js:300:23)
at PuppeteerExtra.launch (/snapshot/project-name/node_modules/puppeteer-extra/dist/index.cjs.js:118:14)
at Browser (/snapshot/project-name/browser.js)
at async main (/snapshot/project-name/index.js) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/snapshot/project-name/node_modules/puppeteer-extra/dist/index.cjs.js',
'/snapshot/project-name/browser.js',
'/snapshot/project-name/index.js'
I fix this by importing the plugins that stealth are referencing 1 by 1 (they are 11) Or you can change tool to create exe, nexe doesn't give this error
see this issue