Mine is located here - \\wsl.localhost\docker-desktop-data\data\docker\volumes\DevKinsta\public\test-site\wp-content\plugins - so I open that in the terminal and try to run it, but get the following error:
`UNC paths are not supported. Defaulting to Windows directory.
Creating a new WordPress plugin in the my-first-block directory.
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
I have tried running the npx command elsewhere and manually moving the result over, which works, but I also need to be able to open the plugins directory in vs code for development & be able to run npm start in the directory.
It looks like npx uses Command Prompt (cmd.exe) which does not have the proper permissions to create directories in C:\Windows, which is the default when you try to specify a UNC path.
Also, cmd.exe isn’t running as Administrator, so it will get a Operation not permitted error because it’s trying to mkdir (create a directory) in C:\Windows\ which requires Administrator user or group access.
Would you be able to try this solution, and let me know if it works?
Well, you are trying to run Node.Js commands on a UNC path but for more information, I want to tell you that Windows does not fully support UNC. However, to resolve this issue you can do the below steps.
You can use WSL (Window Subsystem for Linux)
You can also use PowerShell or a command prompt
Thanks
Thank you for your reply and suggestion here @Gulshan_Negi
As I could see though, the original poster seems to be using WSL based engine already (in the Docker Desktop) as it was mentioned above:
So yeah, I think the issue with the UNC path above is due to that WSL network path would need to be mapped to an actual local drive in Windows first
(with something like: net use z: \\wsl.localhost\docker-desktop-data
where z: can be changed with any local drive we want to map/assign for that network path - as long as they don’t exist on our local computer).
After that’s done, the path and its sub-folders and files could be accessed via CMD/PowerShell - similar to what I suggested in another post here (where Visual Studio code was unable to open/edit the WordPress files located in that WSL network path).