Hi,
I'm on Windows 7 Ultimate and this is the very first time I installed/used node.js and npm. The Windows installer and/or npm incorrectly assumes that folder %APPDATA%\npm exist.
PROBLEM:
In a fresh node.js installation 'npm' does not work. It throws Error: ENOENT, stat 'C:\Users\hb\AppData\Roaming\npm'.
SOLUTION:
Create folder %APPDATA%\npm exists and retry.
REPRODUCIBLE EXAMPLE:
1. Delete %APPDATA%\npm (emulate fresh/first-timer installation)
2. Installed node-v0.10.31-x64.msi [6,103,040 bytes; 5e296a19fe466f278c1620ebdc5985b3] accepting all defaults.
3. Launch cmd.exe and do the following:
{hb}: node --version
v0.10.31
{hb}: npm --version
Error: ENOENT, stat 'C:\Users\hb\AppData\Roaming\npm'
{hb}: npm
Error: ENOENT, stat 'C:\Users\hb\AppData\Roaming\npm'
{hb}: mkdir %APPDATA%\npm
{hb}: npm --version
1.4.23
After this 'npm install ...' works.
My $.02
/Henrik