Skip to content

[BUG] npm install <folder> while absolute path or parent level ("../") provided #4165

Closed
@spamshaker

Description

@spamshaker

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

npm install ../relative-path-to-my-module doesn't resolve the dependencies of the installed module

this happens only when path goes to the directory level up like "my-module-a:file:../my-module-a" or if the path is absolute.

Expected Behavior

the dependencies should be installed in current module

should behave the same way as yarn install command
image

Steps To Reproduce

  1. checkout example git clone https://github.com/spamshaker/npm-bug
  2. cd npm-but/my-module-b
  3. npm install
  4. See react dependency is not installed in my-module-b
    image
    react dependency should be resolved and installed in my-module-b

Environment

  • npm: 8.3.0
  • Node: 16.13.0
  • OS: Windows 11
  • platform:
  • npm config:
; copy and paste output from `npm config ls` here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingDocumentationdocumentation related issuePriority 2secondary priority issueRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions