Installing puppeteer with `npm i puppeteer` does not install transitive dependencies
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.14.0
- Platform / OS version: Windows 10, 64-bit
- URLs (if applicable):
- Node.js version: 8.9.4
- Angular version: 7.1.4
What steps will reproduce the problem?
Please include code that reproduces the issue.
- Install puppeteer in a new Angular 7 project as follows:
npm i puppeteer
- Copy the code found in the documentation to save as pdf in some angular component method:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
await browser.close();
})();
- Run
ng serve
to run the application - There will then be a compilation error:
ERROR in ./node_modules/puppeteer/node_modules/mime/index.js Module not found: Error: Can't resolve './types/other' in 'C:\Users\062276\myssa-repos\puppeteer-test\node_modules\puppeteer\node_modules\mime' ERROR in ./node_modules/puppeteer/node_modules/mime/index.js Module not found: Error: Can't resolve './types/standard' in 'C:\Users\062276\myssa-repos\puppeteer-test\node_modules\puppeteer\node_modules\mime' ERROR in ./node_modules/puppeteer/lib/Launcher.js Module not found: Error: Can't resolve 'http' in 'C:\Users\062276\myssa-repos\puppeteer-test\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/Launcher.js Module not found: Error: Can't resolve 'os' in 'C:\Users\062276\myssa-repos\puppeteer-test\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/JSHandle.js Module not found: Error: Can't resolve 'path' in 'C:\Users\062276\myssa-repos\puppeteer-test\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/Launcher.js Module not found: Error: Can't resolve 'path' in 'C:\Users\062276\myssa-repos\puppeteer-test\node_modules\puppeteer\lib' ERROR in ./node_modules/puppeteer/lib/WebSocketTransport.js Module not found: Error: Can't resolve 'ws' in 'C:\Users\062276\myssa-repos\puppeteer-test\node_modules\puppeteer\lib' i 「wdm」: Failed to compile.
- Manually installing some of the missing packages does not resolve the issue either. For example, run
npm install http
, and runng serve
again. You’ll still get the “module not found” error.
What is the expected result? All dependencies should be downloaded and there should be no compilation errors.
What happens instead? Some of the dependencies are not downloaded and there are compilation errors.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@pmandayam depends on your needs and what you’re trying to achieve. Also, note: the
puppeteer-web
cannot launch browser - it can only connect to one.@pmandayam check out this doc.