user3760959
user3760959

Reputation: 455

Can't install puppeteer package on node

I am facing problem while installing puppeteer package.

Error Screenshot

My NPM version : 6.9.0

Node version : v10.16.0

Tried with :

sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib
sudo chown -R $(whoami) /usr/local/bin

But it was no help.

I found the similar question over stackoverflow and went with this answer. But still couldn't figure out how to resolve mine.

Upvotes: 1

Views: 4962

Answers (1)

Md. Abu Taher
Md. Abu Taher

Reputation: 18816

What is cacache?

cacache is a Node.js library for managing local key and content address caches. It's really fast, really good at concurrency, and it will never give you corrupted data, even if cache files get corrupted or manipulated.

It was originally written to be used as npm's local cache, but can just as easily be used on its own.

Fix 1

Copying this answer from npm.community and adding a bit more,

Changing the ownership of files and then avoiding use of sudo is a possible work-around for EISDIR with global installs using sudo. Assuming this is your personal computer, and installing to default location on Mac:

sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib
sudo chown -R $(whoami) /usr/local/bin

Then try your command again without sudo. e.g.

npm install -g npm@latest

Now, clean the cache,

npm cache clean --force

And install your package normally without sudo,

npm i puppeteer

Fix 2

From this SO answer, the answerer had same problem when he upgraded to npm 6.9.0, the solution was to reinstall and upgrade node,

brew reinstall node

Fix 3

An old issue on npm related to .staging provided this fix.

Try to delete the package lock files and reinstall the packages,

rm -rf node_modules
rm -f package-lock.json
npm install

Upvotes: 1

Related Questions