5

I just installed nodejs x64 on my Windows 10 computer. I keep all default config, I open cmd and type: npm -v

Then i got following error:

module.js:457
    throw err;
    ^

Error: Cannot find module 'umask'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\W10-PRO\AppData\Roaming\npm\node_module\npm\lib\utils\umask.js:1:75)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

Every command start with "npm" create this error and npm cannot uninstall, update itself) Please help me fix this error?

3 Answers3

2

update your npm

$ npm install npm -g
Nitin9791
  • 1,124
  • 1
  • 14
  • 17
1

I would try to update/install NPM

$ npm update -g npm
Cohars
  • 3,822
  • 1
  • 29
  • 50
  • npm cannot update or uninstall itself, it throw the same error – SM-Flawless Sep 13 '16 at 15:31
  • How did you install nodejs? I would recommend using nvm or something like that... maybe you could `npm install -g umask` so that it would find it anyway, but it might not be the only one missing. – Cohars Sep 13 '16 at 16:12
  • Thanks, I fixed this error by create a new windows user account, log in this account and install nodejs. Other account still not work, Perhap the old account (named: "W10-PRO") have special character (i think "-" character) that didn't processed property – SM-Flawless Sep 14 '16 at 10:11
0

I know the answer!

Uninstall nodejs.

Delete all references to npm and nodejs (Program Files, Program Files(x86). Then also delete those in AppData/Roaming (npm and npm-cache to be sure).

Reinstall nodejs.

It works!

gabn88
  • 781
  • 8
  • 23