On Windows npm install silently fails

If you are using the node package manager to manage some of the dependencies of your project, you must be familiar with the npm install command that installs the required dependencies locally for the current directory.


I came across an issue, when this command did nothing despite the fact that my package.json was correct, and I also had npm set up on my computer correctly. I am sure about this, because I have recently used it in other projects where there wasn’t any issues with it.

But in this case, when I issued the npm install command, it just silently failed and did not produce any error messages. I checked my directory and really nothing happened, because the node_modules directory was still nowhere to be found.

The reason for this issue was that my command line window was not opened with administrator privileges by selecting the Run as administrator option in the context menu. After opening the command line with administrator privileges, the issue had been solved.

This happened to me on a Windows 7 machine. I realize that similar symptoms could be caused by other issues as well, but in my case this was the thing that helped.