user2972081
user2972081

Reputation: 641

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

Upvotes: 4

Views: 846

Answers (1)

Nathan
Nathan

Reputation: 2970

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

Upvotes: 3

Related Questions