2

Trying to install puppeteer in windows which is installed but app is not coming with the below errors.

Module not found: Error: Can't resolve 'http' in 'C:\xxx\my-pup\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/Launcher.js Module not found: Error: Can't resolve 'https' in 'C:\xxx\my-pup\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/Launcher.js Module not found: Error: Can't resolve 'os' in 'C:\xxx\my-pup\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/Launcher.js Module not found: Error: Can't resolve 'path' in 'C:\xxx\my-pup\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/JSHandle.js Module not found: Error: Can't resolve 'path' in 'C:\xxx\my-pup\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/WebSocketTransport.js Module not found: Error: Can't resolve 'ws' in 'C:\xxx\my-pup\node_modules\puppeteer\lib'

Even tried to install http,https,os,path,ws but still the same .

Tried installing different versions of puppeteer and other dependencies from npm page.

Cleaned the cache npm cache clean --force

Installed latest node, npm versions and latest angular-cli

Optimus
  • 65
  • 1
  • 11
  • Unfortunately Puppeteer will not work normally with Angular, React, Vue etc. because they are browser based and puppeteer requires nodeJS. – Md. Abu Taher Jun 07 '19 at 02:29
  • Possible duplicate of [How to run Puppeteer code in any web browser?](https://stackoverflow.com/questions/54647694/how-to-run-puppeteer-code-in-any-web-browser) – Md. Abu Taher Jun 07 '19 at 02:29
  • any other alternative to puppeteer that can be used in Angular ? – Optimus Jun 13 '19 at 10:10
  • That would be like asking if you can run a browser inside a browser. You need a server somewhere, there is no other way, as far as I know. – Md. Abu Taher Jun 13 '19 at 10:20
  • Interesting since we have no other way. Server/client setup will complicate smooth installation. – Optimus Jun 13 '19 at 10:26
  • How do you start the Angular/Puppeteer application? All the examples I see start the application with `ng test app` but I don't want to test it, I want to use it to generate PDFs/images at server side – ps0604 Jul 14 '20 at 12:07

0 Answers0