Skip to content

[BUG] Windows npm install --prefix errors and looks for the package.json in the cwd #7722

Closed as not planned
@AddictArts

Description

@AddictArts

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

Errors saying it cannot find package.json

Expected Behavior

Install packages to the directory where the prefix is and package.json.

Steps To Reproduce

1, Use Windows 11
2. Use Node 18, 20, 22 ...
3. Use latest npm
4. Try an install with --prefix

In this repo https://github.com/get-convex/convex-backend, which has a scripts subfolder.

error

D:\box\rust\convex-backend>npm install --prefix scripts
npm error code ENOENT
npm error syscall open
npm error path D:\box\rust\convex-backend\package.json

Environment

  • npm: 9.8.1
  • Node.js: 18.18.0
  • OS Name: Windows
; node version = v18.18.0
; npm local prefix = D:\box\rust\convex-backend
; npm version = 9.8.1
; cwd = D:\box\rust\convex-backend

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsplatform:windowsis Windows-specific

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions