Alisson Linneker Alisson Linneker - 2 months ago 6
Node.js Question

npm commands not work

No npm command (all!) is working on my Windows 10.

Example:

npm -v

It does not display any information and cmd crashes. Only unlocks if I hit CTR + C and inform "Y":

enter image description here

I've tried reinstalling node.js (v6.6.0 x64 and v5.12.0 x86), tried npm versions v3.10.3 and v3.10.7, but all without success.

How can I fix it?

NEWS:

My

conf.get('prefix')
in afterUser() function on
nodejs\node_modules\npm\lib\config\core.js
it is returning the wrong directory:
C:\Users\Alisson Linneker\'C:\Program


I believe that this is the problem!

Problem solved!

In
nodejs\node_modules\npm\lib\config\core.js
afterUser() function, add before
if (conf.get('prefix')) {
line:

conf.set('prefix', path.resolve(__dirname, '../..', ''))

Answer

In nodejs\node_modules\npm\lib\config\core.js afterUser() function, add before if (conf.get('prefix')) { line:

conf.set('prefix', path.resolve(__dirname, '../..', ''))

Pull request: https://github.com/npm/npm/pull/13995

Comments