npm not response anything after call anything about 'npm'

this is my cmd


C:\Users\name>npm -v
^C^CTerminate batch job (Y/N)? n
6.9.0

C:\Users\name>npm -v
^C^CTerminate batch job (Y/N)? y

C:\Users\name>npm install
^C^CTerminate batch job (Y/N)? y

C:\Users\name>npm 123456789
^C^CTerminate batch job (Y/N)? y

C:\Users\name>npm install
^C^CTerminate batch job (Y/N)? y

C:\Users\name>node -v
v10.16.2 // -->this work. why ‘npm’ not work?

C:\Users\name>node -p process.platform
win32

C:\Users\name>npm --versions
^C^CTerminate batch job (Y/N)? n
^CTerminate batch job (Y/N)? n

C:\Users\name>


this happen after I install nodejs and call ‘npm install…’ but it not show anything in long time. Now, I reset window and reinstall nodejs again but not work. so, what should I do about this? fix any value in DOS? how?

Have you tried to change your npm prefix?

Sounds similar to this issue:

shadowspawn, I can’t change prefix. Have you control word change npm location without ‘npm’?
this is my cmd run by admin


C:\WINDOWS\system32>npm config set prefix %APPDATA%\npmglobal
// --> and this stop again
^C^CTerminate batch job (Y/N)? n
^CTerminate batch job (Y/N)? n

C:\WINDOWS\system32>

Sorry, I was not suggesting you change your prefix. I was wondering if you had tried and that was what broke npm.

Do you have a .npmrc file in your home directory? What is in it?

shadowspawn, you mean in nodejs\node_modules\npm? No, but it’s have only npmrc (no “.”).

  • I take view hidden item already
    and this is inside that file

prefix=${APPDATA}\npm

That is a different file, but still good information, thanks. It looks correct. There are multiple places configuration gets stored.

I am still wondering if it is a prefix problem. Two more questions.

  1. What does this show? (Or does it not respond? I expect it will fail but worth trying!)
npm config list
  1. Do you have a file at C:\Users\%username%\AppData\Roaming\npm\etc\npmrc?

after I try them and test everything too many times. after that, I reinstall window(not recover) and everything works! thank you for everything, sir.

1 Like

Ouch (reinstall)! Hurrah (works)! Glad you have npm working again.