Skip to content

[BUG] npm breaks on Windows when running off a UNC path #1189

@Stanzilla

Description

@Stanzilla

What / Why

Currently when trying to use npm to install a project on UNC path, like WSL, it fails because it tries to use cmd.exe which does not support UNC paths.

When

I run npm install

Where

On a WSL / UNC share

How

Current Behavior

PS Microsoft.PowerShell.Core\FileSystem::\wsl$\Ubuntu\home\stan\projects\personal\WeakAurasCompanion> npm install
'\wsl$\Ubuntu\home\stan\projects\personal\WeakAurasCompanion'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
npm WARN saveError ENOENT: no such file or directory, open 'C:\Windows\package.json'
npm WARN saveError EPERM: operation not permitted, open 'C:\Windows\package-lock.json.415733530'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\package.json'

Steps to Reproduce

Run npm install on a UNC path / WSL

Expected Behavior

  • install works

Who

  • n/a

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 6.xwork is associated with a specific npm 6 releaseplatform:windowsis Windows-specific

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions