npm / npm/cli

[BUG] Workspaces - bundledDependencies missing in tarball after npm pack

Open
#3,466 17 comments 67 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug config:workspaces Priority 2 Release 7.x ws:libnpmpack
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

In a project with workspaces, run "npm install" and then "npm pack -w a" from the root. Packages specified under bundledDependencies of package/a are NOT included inside the node_modules of the resulting tarball (a-1.0.0.tgz)

Expected Behavior

Packages specified under bundledDependencies of package/a are included inside the node_modules of the resulting tarball (a-1.0.0.tgz)

Steps To Reproduce
  1. Clone this sample repository
  2. Ensure you are running npm >= 7
  3. Run npm install in the root of the repository
  4. Run npm pack -w a in the root of the repository
  5. Inspect the resulting tarball (a-1.0.0.tgz)
    -> Missing bundledDependencies package in node_modules, although package/a declares bundledDependencies
Environment
  • OS: macOS 10.15.17
  • Node: 15.8.0
  • npm: 7.18.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked sample repository, run npm install followed by npm pack -w a, and inspect a-1.0.0.tgz. Trace the npm CLI workspace packaging path responsible for bundledDependencies; done means the declared bundled dependency is present under node_modules in the resulting tarball.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.