Skip to content

BUG: npm uses a package from the top level directory, not from its own. #1537

@akopchinskiy

Description

@akopchinskiy

What / Why

npm for some reason, it uses a package from the top level directory, not from its own.
Ambiguous behavior, seems like a bug.

When

/main-project
├─── /node_nodules
├─── /webpack@4
├─── package.json
└─── /sub-project
│      ├── /node_nodules
│      ├── /webpack@3
│      └── package.json

Where

  • n/a

How

Steps to Reproduce

cd .../sub-project
Run script react-scripts from here (/sub-project).
Read error.

Current Behavior

It's using package from folder /main-project
Giving error: You have installed webpack@3 in /main-project

Expected Behavior

It's using package from /sub-project.
No errors, obviously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 6.xwork is associated with a specific npm 6 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions