0

I have recently installed nodejs and npm on windows. Everything is fine with it. However, for some reason npm does work in cmd, but gives the following error when called on git-bash.

module.js:327
    throw err;
 ^

Error: Cannot find module 'B:\b\programma's\Nodejs\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:974:3
module.js:327
    throw err;
    ^

Error: Cannot find module 'B:\b\programma's\Nodejs\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:974:3

I noticed that the path apears to be B:\b\, meaning that somewhere npm selects the drive twice.

I am aware of the fact that my question looks a lot like this question. I did check my windows PATH variable, and the nodejs folder(including npm folder) are in there.

I also saw this post, and the git-bash does not tell me that npm is not found

I hope someone can help me with this problem

Community
  • 1
  • 1
Jelmergu
  • 973
  • 1
  • 7
  • 19

1 Answers1

1

Looks like one of your directories has a ' in it. I would back everything up, change that directory to something simple like prog without any punctuation, uninstall Node and git-bash, and very carefully follow the instructions reinstalling them.

Jason Livesay
  • 6,317
  • 3
  • 25
  • 31
  • Thanks, never expected that that folder would give problems, seeing that every other program is installed into that folder. I have now installed node in the default folder and when running `npm -v` it tells me the correct version – Jelmergu Oct 04 '16 at 05:28