Search code examples
node.jsreactjswindowsnpmyarnpkg

Why "Error: EINVAL" & "EPRM:Permission denied" Problem causing in nodejs?


When i tried to run npm create-react-app and yean create react-app command, It returned me an error of Error: EINVAL: invalid argument, mkdir 'C:\Users\<User Name>\AppData\Roaming\npm'

I tried to clear the catch with the *npm cache clear* *npm cache clean --force* command. But the results are the same as before.

what causes it and how can I solve this?


Solution

  • Use WIN+R to open a small window of operation, and then enter '.' (dot) And click OK, so that you enter the system user directory of your C drive;

    After entering the system user directory, you can find the file .npmrc This file, after opening this file, you can see the see the prefix value

    now change whatever the prefix=xxxx value is. with the given image. And now try again.

    This solved my problem. or lookup this link: https://www.programmersought.com/article/91716179653/