error cannot find module 'umask'

社会主义新天地 提交于 2019-12-23 13:27:30

问题


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?


回答1:


update your npm

$ npm install npm -g



回答2:


I would try to update/install NPM

$ npm update -g npm



回答3:


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!



来源:https://stackoverflow.com/questions/39469580/error-cannot-find-module-umask

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!