1
votes

$ npm -v Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_globa l' TypeError: Cannot read property 'get' of undefined at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-ha ndler.js:213:17) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:83:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:215:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:253:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:81:7 at Array.forEach () at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:80:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25: 25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js: 178:20) at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47: 53 C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:213 if (npm.config.get('json')) { ^

TypeError: Cannot read property 'get' of undefined at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\ error-handler.js:213:17) at emitOne (events.js:115:13) at process.emit (events.js:210:7) at process._fatalException (bootstrap_node.js:373:26) 5.3.0

1
Welcome to Stack Overflow. Please review the How to Ask section and provide a [mvce] by editing your question.compor

1 Answers

0
votes

First of all welcome to SO ;) As compor stated - first read the article on how to ask and format good questions. Try to supply the version of node, your os and other relevant information such as privileges etc.

Regarding your error - try to clean the cache and reinstall npm:

npm cache clean --force

npm install -g npm@latest