npm install socket.io and socket.io-client results in an error

(Harusunbear) #1

What I Wanted to Do

Tried installing socket.io and socket.io-client locally

What Happened Instead

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! <https://npm.community>

Reproduction Steps

npm install socket.io

0 Likes

(John Gee) #2

(Moved to #support)

Hi @harusunbear! The “cb() never called!” is not the underlying error, and hopefully there is another error visible in the console or in the log. There were some issues that were fixed in npm 6.6.0 to make sure all the errors get displayed, so if you have an older version then first step is to update.

0 Likes

(Brandon Nolet) #3

Unhandled rejection Error: EACCES: permission denied, open '/home/brandon/.npm/_cacache/index-v5/11/d7/9a389bd7520ad1bcdc6a2a050876d7783dc3ec357143c6c6c7c8df92bd82'

This is what was displayed directly before the npm ERR! entries in the terminal

Running with superuser perms works fine, but of course that’s far from desirable.

0 Likes

(John Gee) #4

@LinuxLiaison

There is an open issue with installing global packages using sudo leaving behind files with the wrong ownership.

The short version is run this to fix the ownership, then try your install again:


sudo chown -R $(whoami) ~/.npm

The long version and canonical bug is: Global installs (sudo npm i -g) fail on Mac after 6.5 upgrade. Works fine after 6.4.1 downgrade.

0 Likes

(Brandon Nolet) #5

Seems that was the issue.

I removed socket.io with sudo, ran the chown snippet you posted, then installed socket.io again without sudo and there were no issues.

Strange how this sort of thing didn’t happen when installing other modules.

1 Like