npm in fresh Windows install gives "Error: ENOENT, stat 'C:\Users\hb\AppData\Roaming\npm'" (with solution)

89 views
Skip to first unread message

Henrik Bengtsson

unread,
Sep 13, 2014, 9:49:51 PM9/13/14
to nod...@googlegroups.com
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


Reply all
Reply to author
Forward
0 new messages