visual studio code CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory

Viewed 5722

I am new to javaScript, trying to set up Visual Studio Code. I have installed NodeJs and Visual Studio Code, with windows Powershell.

In visual studio > terminal if I run npm view command I am getting following error

CMD .EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
npm ERR! Invalid package

Can anyone please take a look at this issue. Is this because of restrictions on corporate systems?

1 Answers

It looks like your project directory (and your profile) is stored on a network fileshare, which is quite common in corporate environments.

You can ask your IT to create a mapped drive with your profile, or you can use the pushd command to create a temporary mapping.

  1. Before opening the project in Visual studio run this from your command line (replace the path with your actual UNC path):

    pushd \\corpserver\share$\jdoe\projects\java\...

    the command will place you in the newly created temporary drive.

  2. Copy the new temporary path

  3. Open Visual Studio Code and open your project from this temporary path

  4. You should now be able to use terminal and build/run scripts

Related