0

I have installed node 12.16.2

Unfortunately, when i run npm i am getting an error

I think this is due to some default user account issue occurred after i updated windows 10

Previously my user account was at C:\Users\Peter

after the windows 10 update it is now at C:\Users\Peter.000

I doubt that this has a direct connection to the error mentioned in the subject

Error: EINVAL: invalid argument, mkdir 'C:\Users\Peter.000\'C:\Users\User\AppData\Roaming\npm''

Error: EINVAL: invalid argument, mkdir 'C:\Users\Peter.000\'C:\Users\User\AppData\Roaming\npm''
zaster
  • 95
  • 2
  • 9

4 Answers4

6

This problem is due to the wrong prefix which can be changed by finding .npmrc file present in C:\Users\<your_account_name>

Set it as

prefix="D:\\node\\node_global"

I hope your problem gets solved.

Arghya Sadhu
  • 35,183
  • 9
  • 62
  • 80
0

I was able to create another windows account and run npm from there. However, still couldn't find out a way to run npm from my default windows user account (C:\Users\Peter.000)

How to completely remove node.js from Windows Helped me solve the issue

zaster
  • 95
  • 2
  • 9
0

Install npm-check-updates and try again.

I was facing the same issue I resolve it with these steps:

  • npm install -g npm-check-updates // It will update the npm dependencies. (After that I checked my issue was resolved)

  • npm install //It will update the dependencies and install the dependencies.

Hope It will work :)

Abhishek saharn
  • 841
  • 9
  • 22
Uddesh
  • 1
0

open .nmrc file which is present in C:\Users<your_account_name> and change the prefix to C:\Users<your_account_name\AppData\Roaming\npm (you can open .nmrc file with the help of vscode it worked for me).