Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

> [email protected] 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"
    },
like image 688
Jazzy Avatar asked Oct 21 '25 06:10

Jazzy


1 Answers

I only managed to fix the above issue by manually installing Chromium using the below command on the command line

node node_modules/puppeteer/install.js
like image 55
Afshin Ghazi Avatar answered Oct 24 '25 15:10

Afshin Ghazi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!