question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installing puppeteer with `npm i puppeteer` does not install transitive dependencies

See original GitHub issue

Steps 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.

  1. Install puppeteer in a new Angular 7 project as follows: npm i puppeteer
  2. 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();
})();
  1. Run ng serve to run the application
  2. 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.

  1. Manually installing some of the missing packages does not resolve the issue either. For example, run npm install http, and run ng 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aslushnikovcommented, Apr 5, 2019

Do I copy over the ./utils/browser/puppeteer-web.js file that was built to my Angular project in another folder?

@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.

1reaction
aslushnikovcommented, Apr 5, 2019

@pmandayam check out this doc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

puppeteer-extra - npm
A light-weight wrapper around puppeteer and friends to enable cool plugins through a clean interface. Installation. yarn add puppeteer puppeteer ...
Read more >
How to install npm peer dependencies automatically?
npm v7 has reintroduced the automatic peerDependencies ... The project would not automatically use the globally installed packages.
Read more >
How npm Deals with Transitive Dependencies - Beyond Java
But fear not - that's one of the reasons why the package.lock file has been invented. npm audit fix solves most of those...
Read more >
pnpm/pnpm - Gitter
Just installed puppeteer & it doesn't give an error but it's the only ... lists an npm package as dependency, npm install will...
Read more >
Contributing - Puppeteer
npm install # or PUPPETEER_PRODUCT=firefox npm install ... ensure you have correct Chromium version installed locally (you only need to do this once,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found