chromiumpuppeteerjest-puppeteer

Why do I need to "reinstall" Puppeteer by running `node install.js` after `npm install`? (Error: Chromium revision is not downloaded.)


Otherwise, when I try to run tests using Puppeteer, I get Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"

It would seem that npm i with Puppeteer in my deps would be enough, but after install completes, I need to cd into /node_modules/puppeteer then run node install.js to get the correct revision downloaded.

When I do initial npm i I see

> puppeteer@1.13.0 install /Users/.../node_modules/puppeteer
> node install.js

Downloading Chromium r549031 - 76 Mb [====================] 100% 0.0s
Chromium downloaded to /Users/.../node_modules/puppeteer/.local-chromium/mac-549031

But this doesn't work and I get the revision error.

After I node install.js in Puppeteer's dir, I see

Downloading Chromium r637110 - 85.9 Mb [====================] 100% 0.0s
Chromium downloaded to /Users/.../node_modules/puppeteer/.local-chromium/mac-637110

then I am good to go.

Any ideas why? This is on macOS & Node 10.15 and I assume it's going to be more difficult to do this in CI.

I have searched around and found others with this problem, but no solid ways around this.

package.json

    "devDependencies": {
        "@babel/core": "^7.3.3",
        "@babel/preset-env": "^7.3.1",
        "babel-jest": "^24.1.0",
        "babel-loader": "^8.0.5",
        "eslint": "^5.14.1",
        "html-webpack-plugin": "^3.2.0",
        "husky": "1.1.2",
        "jest": "^24.1.0",
        "jest-puppeteer": "^4.1.0",
        "lint-staged": "7.3.0",
        "prettier-eslint-cli": "4.7.1",
        "puppeteer": "^1.13.0",
        "webpack": "^4.29.5",
        "webpack-bundle-analyzer": "^3.1.0",
        "webpack-cli": "^3.2.3",
        "webpack-dev-server": "^3.2.1",
        "webpack-shell-plugin": "^0.5.0"
    },

Solution

  • Unfortunately, another module's package.json had added puppeteer_chromium_revision to my .npmrc and was effectively hardcoding a revision for Puppeteer.