Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJs 19 + NPM 8.19.3 why Puppeteer is installed on /root/.cache/?

Using NodeJs v19.0.0 and NPM 8.19.3 (fresh install) on a Linux Debian 10 vm

I recently noticed that when installing Puppeteer it is installed on /root/.cache/ folder:

/root/.cache/puppeteer/chrome/linux-1056772/chrome-linux/chrome

The command I used for installation is this:

npm install -g puppeteer --unsafe-perm=true

However, in the "old days" it used to install on /usr/lib/node_modules/

I tried almost everything but no luck, e.g:

export npm_config_prefix=/usr/lib/node_modules
npm install -g puppeteer --prefix /usr/lib/node_modules --unsafe-perm=true

Has something changed recently? How can I install Puppeteer on /usr/lib/node_modules/?

PS: I am logged in as root

like image 504
user2972081 Avatar asked Oct 23 '25 16:10

user2972081


1 Answers

I found this pull request because I came across the same issue trying to rebuild a docker image recently. Essentially changed the default install folder for chromium. The solution was for me to use the env var mentioned in that PR in my Dockerfile.

env PUPPETEER_CACHE_DIR=/home/web/.cache
like image 152
Nathan Avatar answered Oct 26 '25 06:10

Nathan



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!