The Problem

When installing Socket.io on Node.js (Windows) via the following NPM command:

npm install socket.io

You may receive the following error:

Error: ENOENT, stat 'C:\Users\...\AppData\Roaming\npm'

Mmmm, ambiguous error messages. :trollface:

The Solution

Apparently this is a bug in the currently current version of Node.js (v0.10.32) and/or NPM (v1.4.28). The solution is straightforward and just requires creating the above noted “npm” folder within AppData. I’m sure you can figure this out, but copy-pasting is much more fun:

mkdir %APPDATA%\npm

That’s it. You should now be able to execute the NPM command to install Socket.io without any errors. Note you will probably need to run this command with administrative privileges. I didn’t need to run my command line as an Administrator, but I’ve read that you may have to (yes, you, specifically; the Google referred to you by name.)


Resources

I am available to help you

If you'd like to learn how I help developers and teams build better software, schedule a free 30-minute call with me.

Schedule a Call With Me

Free Guide: Do These 10 Things Every Day

Be awesome. Download my FREE guide to become a better developer and team member (without learning more about code!)

Enter your email address below and get it immediately.