npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

strange npm problem, command never finishes, hangs forever

This is windows 10, node-v10.15.3-x64.msi install.

using either command prompt or power shell I type npm and nothing happens and it doesn’t bomb or returns to the prompt. Just the little blinking dot that lies to me saying it is doing something. When I stop being fascinated by this blinking dot and hit control c it says Terminate batch job (y/n) ? y gives me back my prompt. Obviously there was some process running but I am not getting a functioning program. Any ideas? I know this is the head scratch kind of problem that does not usually get answered but I can’t be so special nobody else has this happen.

What underlying tech does npm rely on? python?

when i type node - v I get v10.15.3 when i type npm -v I get nada but blinking dot forever. frustrating.

Did you make changes to the prefix location before it broke, or have you got a clean install? i.e. had you used npm config set prefix?

Ok with help from the other thread I got it figured out.

Yes I screwed with prefix to my detriment. The reason why I kept going round and round deleting and reinstalling is I missed .npmrc in my user directory. The prefix in it was set to a path that no longer existed. I deleted my profile .npmrc and it started working again. I have now learned that is the file to edit to set prefix and cache.

Now the structure of the nodejs stock install for npm is bizarre imho. The npm executables are in the nodejs directory. Node itself is installed nodejs/node_modules/npm. The npm modules are path nodejs/node_modules/npm/node_modules.

Initially I changed my personal .npmrc to this contents

prefix=“C:\Program Files\nodejs\node_modules\npm”
cache=“C:\Program Files\nodejs\node_modules\npm”

This stopped npm from installing into my appdata/roaming directory but it kept bombing because it could not create the cache directories because it was in Program Files

But I was happy because it was trying to install global into one directory instead of my profile roaming. The main reason I started this odyssey is I wanted global modules in ONE location.

So what I did was moving nodejs from program files to another directory.

change my profile .npmrc to this


changed the path entry for nodejs in paths in system properties / advanced / environmental variables / system variables / path to C:\nodejs.

I also keep deleting path in the top path in user variables but it seems to keep coming back like Freddy Krueger. Doesn’t seem to do any harm now though.

A lot of examples try to set prefix to nodejs\npm. Maybe that was kosher at one time but now the npm executable called npm is in the nodejs root directory.

Okay I am not a tech writer but I hope this will provide clues to other clueless like me. Cheers!