puppeteer-heroku-buildpack: mv: cannot stat '/app/.cache/puppeteer': No such file or directory

 > mkdir ./.cache && mv /app/.cache/puppeteer ./.cache
       
mv: cannot stat '/app/.cache/puppeteer': No such file or directory
-----> Build failed

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 2
  • Comments: 19

Most upvoted comments

This fixed it for me: Make sure the puppeteer buildpack is placed before the node js:

  1. Puppeteer
  2. NodeJS

For your package.json, add this line as the last thing to do after building everything else

 "scripts": {
    "build": "node node_modules/puppeteer/install.js && mkdir -p ./.cache && mv /app/.cache/puppeteer ./.cache",
}

before deploying: heroku builds:cache:purge -a YOUR_APP

@ElitKondor "puppeteer": "^16.2.0",

I got it to work by following creating a .cjs file etc from this post https://stackoverflow.com/questions/52225461/puppeteer-unable-to-run-on-heroku

Having some other cloudinary api_key issues now though.

Thank you @hitwill 🙏

ok I am facing a weird thing where,

if I purge, then trigger a deploy, it would work

but then if there is another deploy triggered, it would complain about the same error that is the title of this issue

Follow the conversation from here

@hitwill how were you able to find the solution? thank you!

Follow the conversation from here: https://github.com/jontewks/puppeteer-heroku-buildpack/issues/130#issuecomment-1720774565

worked thanks @hitwill

install

@opeyemidy try node node_modules/puppeteer/install.mjs

(mjs instead of js)

@hitwill does it work with the latest version of puppeteer?

@opeyemidy yes. I am using: “puppeteer”: “^21.2.0”

I had to downgrade puppeteer