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

Problem with PUPPETEER_SKIP_CHROMIUM_DOWNLOAD #2262

Closed
Tmin10 opened this issue Mar 26, 2018 · 6 comments
Closed

Problem with PUPPETEER_SKIP_CHROMIUM_DOWNLOAD #2262

Tmin10 opened this issue Mar 26, 2018 · 6 comments

Comments

@Tmin10
Copy link

Tmin10 commented Mar 26, 2018

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.2.0
  • Platform / OS version: windows 10 x64
  • URLs (if applicable): -
  • Node.js version: 8.1.3 / NPM: 4.1.2

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. Add "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD": true into package.json config section.
  2. Add PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true to local .npmrc file.
  3. Run npm config set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true to put property in global .npmrc file.
  4. Run npm i puppeteer to install puppeteer.

What is the expected result?
Puppeteer won't download chromium.

What happens instead?
Puppeteer downloaded chromium. (-_-)

In install.js we can see that puppeteer tries to read PUPPETEER_SKIP_CHROMIUM_DOWNLOAD, NPM_CONFIG_PUPPETEER_SKIP_CHROMIUM_DOWNLOAD and npm_config_puppeteer_skip_chromium_download environment variables and didn't read any config.

How it could work? Who should have to fill this variables if I would like to use only npm config without global envirements?

@jeffguorg
Copy link

try this:

env PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm i puppeteer

or just set it in your shell and run npm

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
npm i puppeteer

i'm not experienced in node.js, but if i'm right, process.env only reads environment variables from the parent of the process, which is your shell.

@alixaxel
Copy link
Contributor

@Tmin10 Check the solution on #2270.

@kwkbtr
Copy link

kwkbtr commented Apr 3, 2018

I tried this by adding the following to package.json and it did not work:

"config": {
  "puppeteer_skip_chromium_download": true
}

According to npm documentation, the variable specified in package.json is prefixed by npm_package_config_, not npm_config_.
It would be useful if the install.js checks the former one too.

(I thought that adding the variable to package.json would work when I read the description about environment variables but now I realize that the description refers to npm config, not config variable in package.json)

@aslushnikov
Copy link
Contributor

Dupe of #2270.

It would be useful if the install.js checks the former one too.

@kwkbtr feel free to send a PR.

@sapanprajapati
Copy link

Simply do this.
npm config set puppeteer_skip_chromium_download true -g
working for me like charm :)

aslushnikov pushed a commit that referenced this issue Nov 14, 2018
This PR support set ```puppeteer_skip_chromium_download```, ```puppeteer_download_host``` and ```puppeteer_chromium_revision``` in ```config``` of ```package.json```

Fixes #2262
@icfantv
Copy link

icfantv commented Apr 19, 2019

To build on @sapanprajapati's answer above, please see my comment in #2270. It appears you don't need this as a global setting, rather you can just make it at the project level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants