Error: EPERM: operation not permitted, mkdir 'C:\Users\MY'

1.4k Views Asked by At

Can't run npx commands in windows 8.1 pro. showing error

Error: EPERM: operation not permitted, mkdir 'C:\Users\MY'

my folder path contains space. full command and error here.

C:\Users\MY PC\Desktop\renaitv>npx create-react-app tsst
Error: EPERM: operation not permitted, mkdir 'C:\Users\MY'
command not found: create-react-app
2

There are 2 best solutions below

2
Alan Cheung On

Try creating a symbolic link from C:\Users\MY PC\Desktop\renaitv to C:\Users\MY%20PC\Desktop\renaitv where %20 represents the space.

Command line commands distinguish different segments of the command, argument, and options using spaces. As you can tell this is in particular an issue with default Windows folders ("My Documents", "User/First Last", etc).

Normally to get around the issue, you can simply surround arguments with "" or '' characters. But when you don't control the command being invoked you can create a symbolic link between the original folder path and a file URI encoded folder path.

0
Randeep Rana On

Restart your PC and run VS code as Administrator. It will work.