1
votes

I already tried to uninstall the Nodejs and reinstall an other version but I keep on getting this error every time I run the command npm install or npm. when I try npm -v it returns the version.

My current installed nodejs versions is 10.16.0 and NPM is 6.12.0.

TypeError: mkdirp is not a function at Conf.setUser (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\set-user.js:22:3) at Conf.loadExtras (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:225:8) at Conf. (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:166:12) at Object.onceWrapper (events.js:286:20) at Conf.emit (events.js:198:13) at ConfigChain._resolve (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\node_modules\config-chain\index.js:281:34) at ConfigChain.add (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\node_modules\config-chain\index.js:259:10) at Conf.add (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:338:27) at Conf. (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:314:25) at ReadFileContext.callback (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:90:16) C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\npm.js:59 throw new Error('npm.load() required') ^

Error: npm.load() required at Object.get (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\npm.js:59:13) at process.errorHandler (C:\Users\mrosus\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:205:32) at process.emit (events.js:198:13) at process._fatalException (internal/bootstrap/node.js:496:27)

1
Deleting manually the npm folder inside AppData\Roaming solves the problemmrosus

1 Answers

0
votes

I had a similar problem, what happened to me was that I changed the version of my node, using a node version manager, I use the "n" https://github.com/tj/n . It turns out that when changing the version I did not see that I had given several error messages "Permission denied", that is, I thought I had changed the version but there was not, that somehow bugged my node and when I tried to use any command with npm it gave mistake.

To solve it, I simply changed the version using sudo, in my case, as I use the "n" node version manager, I ran the "sudo n" command and chose the node version.