1

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''
2
  • Could you give us a bit more information about the error, such as the stacktrace?
    – Caramiriel
    Apr 22, 2020 at 13:04
  • @Caramiriel error information included
    – zaster
    Apr 22, 2020 at 15:19

4 Answers 4

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.

1
  • I need more upvotes for this answer thanks
    – ysk silver
    Jul 6, 2021 at 18:37
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

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 :)

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.