1132

I have Windows 7 32-bit. I installed the latest Node.js 32 bit.
When I try to run the command npm install jquery, I receive the error:

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

How does one resolve it?

6
  • 7
    Try running the command prompt as administrator. Commented Aug 13, 2014 at 0:52
  • 4
    Run command prompt as administrator, and create the folder. Commented Oct 29, 2014 at 9:37
  • To remember the error, you can read it like "Error: NO ENTry". So check the directory whether it exists, otherwise create a new one. If there's no access, you can run the command prompt as administrator. Though for no access error node.js normally arise EACCESS error. Commented Jul 10, 2015 at 7:11
  • Googlers, also note, that you can get this message as an ‘not found answer’ to small path typos, i.e. res.sendfile('pathSlightlyWrong/posts.html') (experienced under Windows 7) Commented Apr 18, 2016 at 8:37
  • My Unhandled event error got fixed in this answer stackoverflow.com/a/52441411/6665568 Commented Jan 3, 2019 at 13:42

12 Answers 12

2108

Manually creating a folder named 'npm' in the displayed path fixed the problem.

More information can be found on Troubleshooting page

Sign up to request clarification or add additional context in comments.

25 Comments

Seems like a bug on the instller.
Is this bug in some tracker? This makes for an awful first experience with nodejs...
This appears a bug with a recent release of Node.js. It wasn't an issue a few months ago. I had to manually create the folder to make it work on Windows 8.1 x64.
It's being tracked by github.com/npm/npm/issues/5905, so you can subscribe to that issue to see progress.
For those who land here later, this is a reported issue at npm/npm#5905 and joyent/node#8117
|
236

This can also be fixed by installing a node package manually.

npm install npm -g

The process of doing that will setup all the required directories.

6 Comments

This is the only one that worked for me. Need to use -g for 'Global Mode' so it installs the packages into your <nodejs application path>. It will place them in the 'node_modules' folder. Otherwise, it will run in local mode and attempt to place the files and directories into the whichever path you are currently in. Sometimes, even running as administrator, you will run into directory access issues.
This is the only solution that worked for me as well running Win 8.1 with the 64-bit installer. Thanks!
This is the cleanest solution!
this also worked when hitting the same problem on OSX, albeit with a different file path
I have just got the error, and found this to be the cleanest option to solve it!
|
115

I ran into the same problem while installing a package via npm.

After creating the npm folder manually in C:\Users\UserName\AppData\Roaming\ that particular error was gone, but it gave similar multiple errors as it tried to create additional directories in the npm folder and failed. The issue was resolved after running the command prompt as an administrator.

3 Comments

Yeah same for me - Win7 and 64 bit. You need to create new folder and then execute npm command on command prompt run as administrator.
Same thing for me in Windows 10. Thanks for the tip.
It worked after reinstalling node, removing npm and npm-cache folders in C:\Users\UserName\AppData\Roaming\ and added the folders again in command prompt as an admin.
12

I recommend setting an alternative location for your npm modules.

npm config set prefix C:\Dev\npm-repository\npm --global 
npm config set cache C:\Dev\npm-repository\npm-cache --global  

Of course you can set the location to wherever best suits.

This has worked well for me and gets around any permissions issues that you may encounter.

Comments

7

you need to creating a folder named 'npm' in the displayed path C:\Users\$userName\AppData\Roaming\ fixed the problem.

enter image description here enter image description here

Comments

6

If you are sure about installing the Npm package, this solution worked for me Run the terminal in administrator and tun command npm install npm -g -g install package globally

Comments

4

First do:

npm i npm -g

Then it will work properly.

Comments

3

You can go to the Start Menu and search the Node.js icon and open the shell and then install anything with

install <packagename> -g

Comments

0

Install a stable version instead of the latest one, I have downgrade my version to node-v0.10.29-x86.msi from 'node-v0.10.33-x86.msi' and it is working well for me!

http://blog.nodejs.org/2014/06/16/node-v0-10-29-stable/

Comments

0

I needed a package from github that was written in typscript. I did a git pull of the most recent version from the master branch into the root of my main project. I then went into the directory and did an npm install so that the gulp commands would work that generates ES5 modules. Anyway, to make the long story short, my build process was trying to build files from this new folder so I had to move it out of my root. This was causing these same errors.

Comments

0

For me I had to change environment variable 'Path' from System variables to have C:\Program Files\nodejs instead of C:\Program Files\nodejs\ (removed the ending slash)

Hope this helps someone, Cheers!

Comments

-2

To fix this error, let's create a new folder.

First, find this location on your computer:

'C:\Users\Username\AppData\Roaming'.

Once you're there, look for a folder called 'npm'. If you can't find it, don't worry - just create a new, empty folder and name it 'npm'.

That's it! Now, try running your command again.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.