The use of PUPPETEER_DOWNLOAD_HOST has been phased out. It is recommended to use PUPPETEER_DOWNLOAD_BASE_URL moving forward. / Puppeteer

Trying to install puppeteer, I followed the installation guide.

However, after a few seconds, I encountered this error:

.../node_modules/puppeteer postinstall$ node install.mjs
│ PUPPETEER_DOWNLOAD_HOST is deprecated. Use PUPPETEER_DOWNLOAD_BASE_URL instead.
│ ERROR: Failed to set up Chrome r119.0.6045.105! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
│ Error: Download failed: server returned code 404. URL: https://npm.taobao.org/mirrors/119.0.6045.105/win64/chrome-win64.zip
│     at file:///C:/Users/Asus/Desktop/WorkSpace/Projects/test/Server/node_modules/.pnpm/@<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="95e5e0e5e5f0e1f0f0e7bef7e7fae2e6f0e7e6d5a4bbacbba5">[email protected]</a>/node_modules/@puppeteer/browsers/lib/esm/httpUtil.js:74:31
│     at ClientRequest.requestCallback (file:///C:/Users/Asus/Desktop/WorkSpace/Projects/torob/Server/node_modules/.pnpm/@<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="631316131306170606114801110c141006111023524d5a4d53">[email protected]</a>/node_modules/@puppeteer/browsers/lib/esm/httpUtil.js:52:13)
│     at Object.onceWrapper (node:events:629:26)
│     at ClientRequest.emit (node:events:514:28)
│     at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
│     at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
│     at TLSSocket.socketOnData (node:_http_client:535:22)
│     at TLSSocket.emit (node:events:514:28)
│     at addChunk (node:internal/streams/readable:376:12)
│     at readableAddChunk (node:internal/streams/readable:349:9)
└─ Failed in 5.1s at C:\Users\Asus\Desktop\WorkSpace\Projects\test\Server\node_modules\.pnpm\<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="453530353520312020370577746b736b75">[email protected]</a>\node_modules\puppeteer
 ELIFECYCLE  Command failed with exit code 1.

After some research, I discovered that using

npm config set puppeteer_skip_chromium_download true
might resolve the issue. However, when I attempted it, I received the following message:

npm ERR! `puppeteer_skip_chromium_download` is not a valid npm option

My Node version: 20.9.0

NPM version: 10.2.4

Yarn version: 1.22.19

PNPM version: 8.11.0

(I used NPM, Yarn, and PNPM)

Note: Puppeteer-core can be installed without any issues.

Answer №1

After going through the content on the Official Documentation, I stumbled upon this fix: simply create a file named .puppeteerrc.cjs in the main directory of your project and insert the following code:

/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
    // Modifies the cache location used by Puppeteer.
    downloadBaseUrl:"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing",
};

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the reason behind a project continuing to run and build even when the dependency listed in package.json is not fulfilled?

After creating a React app, I decided to experiment with the behaviors related to Gemfile and package.json. My curiosity led me to change a single line in package.json from: "react": "^16.14.0", to "react": "^17.14.0", It's worth noting that React ...

What is the best way to switch from http to https in a React application?

When performing audits in Chrome, I encountered a net::ERR_EMPTY_RESPONSE error because Lighthouse was not able to consistently load the requested page. Google developers have recommended configuring my server (possibly node.js) to redirect from http to ht ...

Choosing the image that represents your website in Safari web previews

Every time I check iCloud.com on my Safari top sites, the thumbnail is always the same. I'm curious about how I can automate this for my own website. ...

Having difficulty transferring navigation props between screens using react-navigation

Within my ContactList component, I have utilized a map to render various items. Each item includes a thumbnail and the desired functionality is that upon clicking on the thumbnail, the user should be directed to a new screen referred to as UserDetailsScree ...

Is it possible to close the menu by clicking outside a div or letting it disappear on mouseout after a set period of time?

When visiting a website, you may notice menus that display sub-menus when hovered over. These menus and sub-menus are created using div elements, with the sub-menus hidden initially using style.display = none; The issue arises when a sub-menu is opened an ...

Why does my page keep refreshing even after I close the model?

I am facing the following issues: 1- Whenever I try to close my model by clicking 'cancel', it causes the page to reload. 2- Clicking 'OK' does not send the 'DELETE' request to the server, nothing is received, and the page r ...

Learn how to properly implement cookies in a fetch request within Nextjs

Here is a code snippet to consider: Index.getInitialProps = async function({req}) { const res = await fetch("http://localhost/api/tiles"); const json = await res.json(); } If the /api/tiles endpoint requires access to the uid cookie from the user, t ...

Utilizing data from a JavaScript array and merging it with basic HTML structure

Every day, a js array source on a remote server gets updated: var io = new Array(); nsi[0] = new Array('','Frank','','Factory worker','Mercedes',374.0,26.2,76,181,'',75,'Audi',1456.5,27 ...

Looking to display several charts on a single page with varying datasets?

I have successfully integrated a doughnut chart plugin into my website. However, I would like to display multiple charts on the same page with different data sets. Below is the code snippet for the current chart being used: This is the chart I am using & ...

How to Implement a Loop Inside a JavaScript Alert or Prompt?

Seeking clarity: Is it possible to embed code into an alert() or prompt()? For example, is there a way to include a loop or add data to the alert() or prompt just before execution or during execution? -Appreciate any help ...

What steps are involved in updating React and its dependencies to a targeted version?

I am currently working on a project that has an extensive number of dependencies and is using React 16.8. I have the task of updating React to version 17.0.2, but I want to do it automatically without having to manually check each package for compatibili ...

The Access-Control-Allow-Origin CORS header does not align with the null value on the Ajax request

Encountering the same issue in my browser Cross-Origin Request Blocked: The Same Origin Policy prevents access to the remote resource at http://abc-test123.com/login. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘(null)’). My ...

React Native Expo encountering loading issues with Android emulator

When I run npm start and have the Android simulator open with Pixel 3, clicking a (for Android emulator) results in an error message and the app fails to open on the emulator. Attempting to open the project on Android... Installing Expo on device -Couldn&a ...

Implementing JavaScript functionality based on a specific body class

Is there a way to execute this script only on a specific page with a particular body class? For example, if the page has <body class="category-type-plp"> How can I target my script to work specifically for "category-type-plp"? plpSpaceRemove: fun ...

Tips for preventing "script info" from appearing before the actual output when running npm script my-script

When I execute the command below: $ npm run test There is some information about the test script: > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5d3024703032392831381d6c736d73">[email protected]</a> test ...

Struggling to set up the connection between React-Redux connect and the Provider store

Currently utilizing Redux with React Native for state management. I've set up the store and Provider successfully it seems, as I can utilize store.getState() and store.dispatch(action()) from any component without issue. However, I'm encountering ...

Is there a way to keep the modal window open in React without it automatically closing?

I have been working on a modal window implementation in React. I defined a state variable called modalbool to control the visibility of the modal window. The modal window is displayed only when modalbool is set to true. Additionally, I created a parent com ...

issue with retrieving data from PHP script via ajax

My attempts to use AJAX to call a PHP script have been unsuccessful. I added an echo alert statement in my deleteitem.php script to ensure it was being called, but no matter what I tried, it never executed. Both the PHP script and the JS script calling it ...

Node.js is throwing an error code 344, indicating that it is not possible to manipulate headers after they have already been

I'm still learning about Node and I've encountered this confusing error that I can't seem to figure out. I've searched for similar cases online, but none of them quite match mine. Any help would be greatly appreciated. From what I gathe ...

Difficulty arises in AngularJS Material when attempting to access the same object value using ng-model and ng-change

I'm working with angular-material and facing an issue with an md-switch element. The model of the switch is determined by a value in a JavaScript object. However, I want to avoid directly changing the object value when the user toggles the switch. Ins ...