Skip to content

[BUG] npm i tries to recreate root directory (drive letter) in Windows #6412

Open
@emre1791

Description

@emre1791

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

On Windows when you have a disk partition (W:\) specificly reserved for a package it doesn't detect where node_modules are.

image

Expected Behavior

npm install should install packages as expected

Steps To Reproduce

  1. Create Windows disk partition and set drive letter to W
  2. Go to cd W:\
  3. Run npm install <any package>

Environment

  • npm: 9.6.5
  • Node.js: v19.9.0
  • OS Name: Windows 10 Home Single Language (latest version date 5 May 2023)
  • System Model Name: Omen HP 15-CE008NT
  • npm config:
PS W:\> npm config get
; "builtin" config from C:\Users\eaksy\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = "C:\\Users\\eaksy\\AppData\\Roaming\\npm"

; node bin location = C:\Program Files (x86)\nodejs\node.exe
; node version = v19.9.0
; npm local prefix = W:\
; npm version = 9.6.5
; cwd = W:\
; HOME = C:\Users\eaksy
; Run `npm config ls -l` to show all defaults.

Note: Computer newly formatted, everything in fresh installation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions