Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm7 does not create transitive node_module folders for dependencies referenced via file:/ #2145

Open
mattem opened this issue Nov 7, 2020 · 1 comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@mattem
Copy link

mattem commented Nov 7, 2020

I've searched release notes, however I was unable to see if this was an intended breaking change.

Current Behavior:

When referencing a dependency via file:../path/to/dep, npm@7.0.9 does not install or create the transitive node_modules folder for dep

Expected Behavior:

npm@6.12.0 will create and install the node_modules folder for the referenced dependency

Steps To Reproduce:

mkdir a b

// create the package.json files with dependencies
cat << EOF > b/package.json
{
  "name": "b",
  "version": "1.0.0",
  "dependencies": {
    "lodash": "^4.17.20"
  }
}
EOF

cat << EOF > a/package.json
{
  "name": "a",
  "version": "1.0.0",
  "dependencies": {
    "b": "file:../b"
  }
}
EOF

// create a lock file for b
cd b
npm install --package-lock-only

// install for a, creating lock file and node_modules
cd ../a
npm install

a/node_modules will contain the symlink to ../../b, but with no node_modules for b

Environment:

npm@7:

  • OS: MacOS 10.14.4
  • Node: v15.0.1
  • npm: v7.0.9

npm@6:

  • OS: MacOS 10.14.4
  • Node: v12.13.0
  • npm: v6.12.0
@mattem mattem added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Nov 7, 2020
@darcyclarke darcyclarke added Agenda will be discussed at the Open RFC call and removed Needs Triage needs review for next steps labels Jan 22, 2021
@darcyclarke
Copy link
Contributor

@mattem we are aware of this as a breaking change between v6 & v7 - we're going to consider this as a larger topic as to whether to change back this behavior in the next Open RFC call. As a point of reference, linked deps that are a child of the root will actually be installed fully, whereas if they're linked outside they aren't today (again, as you've seen).

I'll circle back on this when we have an update from the call next Wednesday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants