New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: puppeteer-core trying to load package.json "Cannot find package directory" #8896
Comments
Puppeteer uses package.json to locate the Puppeteer's installation directory because it's where the downloaded browser binaries are stored by Puppeteer. If this functionality is not required for you, you can use the |
@OrKoN unfortunately the same error also occurs with puppeteer-core. I haven't read through the code much, but it looks like in puppeteer-core.ts the method initializePuppeteer is called, where getPackageDirectory is called, which leads to this error. A possible fix could be that getPackageDirectory is only called when packageName != "puppeteer-core". const isPuppeteerCore = packageName === 'puppeteer-core';
const puppeteerRootDirectory = isPuppeteerCore ? undefined : getPackageDirectory(rootDirname); @imtiger posting screenshots or pictures of error messages is a sin. |
Oh, I was under impression, that puppeteer-core would not need this logic at all. Let me double check, if there is no real need, this might be a bug. |
this is my package.json dependencies,i use puppeteer not puppeteer-core. this method throws the exception. |
Bug description
Steps to reproduce the problem:
why does this error occur? I have debugged the app and for reasons unknown to me, puppeteer tried to load a package.json. It can not be that you should push the package.json with a deployment, right?
if i build and run the app locally it works, but only because the package.json exists.
Puppeteer version
16.2.0
Node.js version
16.10.0
npm version
7.24.0
What operating system are you seeing the problem on?
Linux
Relevant log output
The text was updated successfully, but these errors were encountered: