Skip to content
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] Browser is not downloaded. Run "npm install" or "yarn install" #106

Closed
don-aot opened this issue Mar 3, 2020 · 15 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@don-aot
Copy link

don-aot commented Mar 3, 2020

Environment

  • chrome-aws-lambda Version: ^2.1.1
  • puppeteer / puppeteer-core Version: ^2.1.1
  • OS: windows
  • Node.js Version: v10.15.0
  • Lambda / GCF Runtime:

Expected Behavior

Need to working as expected

Current Behavior

Got following error "Browser is not downloaded. Run "npm install" or "yarn install""

Possible Solution

Steps to Reproduce

while initializing the browser the above error occurs
Error in the following line
let browser = await chromium.puppeteer.launch({ args: chromium.args, defaultViewport: chromium.defaultViewport, executablePath: await chromium.executablePath, headless: chromium.headless, });

@don-aot don-aot added the bug Something isn't working label Mar 3, 2020
@gsouf
Copy link

gsouf commented Mar 3, 2020

Not an isolated case. Same here 👍

@alixaxel
Copy link
Owner

alixaxel commented Mar 4, 2020

@don-aot @gsouf Are you getting this on AWS Lambda? I recommend a read to this wiki page.

@gsouf
Copy link

gsouf commented Mar 4, 2020

@alixaxel I'm getting this on my local machine, tried both of npm and yarn

@gsouf
Copy link

gsouf commented Mar 4, 2020

@alixaxel ok got it:

This project is compiled specifically for AWS Lambda (Linux x64) Therefore the binary might not be compatible with your local system, making development trickier.

FYI, I'm running on linux x64 too.

I suggest you mention this on the readme as well as on this comment that is popular puppeteer/puppeteer#3120 (comment).

There is an other issue with this behavior. Our whole test suit becomes pointless locally if we can't run it locally against the binaries that are executed in prod, at least it can slow down development at some point.

@alixaxel
Copy link
Owner

alixaxel commented Mar 4, 2020

@gsouf There's a section on the README about running locally, I guess most people just don't read it.

You can test the binary locally, you just have to make sure that you run it inside a host/container that shares the same architecture/OS as the one that's available on AWS Lambda.

There are already projects for this (lambdaci for instance) - other than that there's not much more I can do.

@alixaxel
Copy link
Owner

alixaxel commented Mar 4, 2020

Which Linux distribution / version are you running?

@gsouf
Copy link

gsouf commented Mar 4, 2020

Nothing fancy, a pretty common Ubuntu 18.04.1 LTS

@gsouf
Copy link

gsouf commented Mar 4, 2020

I suggest you write it higher in the readme and also explicitely stating the same thing that you wrote in the wiki.

@alixaxel
Copy link
Owner

alixaxel commented Mar 4, 2020

@gsouf Will consider that, thanks!

For Ubuntu LTS you should be able to run it locally, all you have to do is set the ENV variables.

@alixaxel alixaxel closed this as completed Mar 4, 2020
@gsouf
Copy link

gsouf commented Mar 4, 2020

Confirm, adding env variables fixed.

@jagadeesh93
Copy link

@gsouf @alixaxel I have the same issue . I am using chrome aws lambda for my serverless function . it was working fine previously now it is giving the above error. could you please tell what are those ENV variables ?

@derek-lewis
Copy link

const chromium = require('chrome-aws-lambda')
const puppeteer = chromium.puppeteer

@jagadeesh93
Copy link

jagadeesh93 commented Mar 31, 2020

@alixaxel @Hectare-Agritech @gsouf Sorry guys.. The solution you give didn't worked for me.

"dependencies": {
    "chrome-aws-lambda": "^1.20.4",
    "puppeteer-core": "^1.9.0",
    "zlib": "^1.0.5"
  }

I use the above package.json file with node version 10.13.0 it worked fine.
When i update the package chrome-aws-lambda to ^2 with node js 10 and nodejs 12. It gives me the above error .

I don't know what happened Previously i was able to run this locally as well as inside aws with chrome-aws-lambda version ^2

@alixaxel
Copy link
Owner

alixaxel commented May 9, 2020

@jagadeesh93 Did you do npm i puppeteer --save-dev?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants