Platform
Which platform does the bug apply to?
NPM
Describe the bug
When trying to select puppeteer as the browser option you get the following errors:
Error: Cannot find module 'puppeteer'
Require stack:
- /usr/lib/node_modules/wappalyzer/browsers/puppeteer.js
- /usr/lib/node_modules/wappalyzer/cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/lib/node_modules/wappalyzer/browsers/puppeteer.js:1:19)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/lib/node_modules/wappalyzer/browsers/puppeteer.js',
'/usr/lib/node_modules/wappalyzer/cli.js'
]
}
Note:
The example above was of me trying the package from the command line, but this issue also happens when you try to use the package in a Node.js project as well.
To Reproduce
Steps to reproduce the behavior:
npm i wappalyzer -gwappalyzer www.google.com --browser=puppeteerExpected behavior
For the wappalyzer package to crawl www.google.com using the puppeteer headless browser.
Additional context
I have attempted to trouble shoot the issue by doing the following:
rm -rf node_modules/)npm cache clear --force)npm i)As well as
npm uninstall wappalyzer)npm cache clear --force)npm i wappalyzer)After looking at the package.json that was downloaded in the npm package, it looks like puppeteer isn't listed as a dependency but as a peerDependency.
"dependencies": {
"zombie": "^6.1.2"
},
"peerDependencies": {
"puppeteer": "^2.0.0"
},
The puppeteer + chromium dependency is very large, which is why it's listed as a peer dependency for now. You'll have to manually install it with npm i puppeteer in order to use it.
$ npm i
npm WARN [email protected] requires a peer of puppeteer@^2.0.0 but none is installed. You must install peer dependencies yourself.
I'll add a note to the README.
Most helpful comment
The puppeteer + chromium dependency is very large, which is why it's listed as a peer dependency for now. You'll have to manually install it with
npm i puppeteerin order to use it.I'll add a note to the README.