Skip to content

Instantly share code, notes, and snippets.

@jfhbrook
Created August 28, 2019 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfhbrook/6aab3a291a1316fb899e8b1a18298d2d to your computer and use it in GitHub Desktop.
Save jfhbrook/6aab3a291a1316fb899e8b1a18298d2d to your computer and use it in GitHub Desktop.

I tried changing my username and home directory on my Windows 10 machine recently, and I got 95% of the cases out of the way, but npm is one of the last ones. The error you're seeing means that npm thinks that my home directory is at c:\Users\Joshua Holbrook instead of c:\Users\Josh. 🙃 So the question is, how do I trace this back to the code that decides where my home directory is?

PS C:\Users\Josh> npm
Error: EPERM: operation not permitted, mkdir 'C:\Users\Joshua Holbrook'
TypeError: Cannot read property 'get' of undefined
at errorHandler (C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\lib\npm.js:228:22)
at C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\lib\npm.js:266:24
at C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:82:13
at f (C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:173:20)
at Conf.<anonymous> (C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:229:20)
C:\Users\Josh\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:205
if (npm.config.get('json')) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment