[BUG] `bundleDependencies` symlinks are not included if packages are not in `package-lock.json`file
Nobody has claimed this yet.
- 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
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
If I install some local dependencies with npm install, and define them as bundle dependencies, and later overwrite the package-lock.json file with the previous one, when doing npm pack the bundle dependencies are not resolved nor included in the tarfile, no matter if the dependencies are defined in the package.json file or not.
Expected Behavior
bundle dependencies must be added in the tarfile as far as they are defined in the bundleDependencies array, no matter if they are defined or not at dependencies field or at package-lock.json file. At most, they should be added automagically in that file, but definitely they should not be ignored.
Steps To Reproduce
- create a dependency package
- create a sibling dependent package
- install the dependency with
npm install ../dependency-package - restore dependent package both
package.jsonandpackage-lock.jsonfiles - add dependency package as a dependent package
bundleDependency - run
npm packon dependent package
Both output of npm pack and tar -t shows that the dependency package is not included
Environment
- npm: 9.5.0
- Node.js: 19.7.0
- OS Name: Ubuntu 22.10
- System Model Name: Slimbook Executive
- npm config:
; "user" config from /home/piranna/.npmrc
//npm.pkg.github.com/:_authToken = (protected)
//registry.npmjs.org/:_authToken = (protected)
frame:apiServer = "127.0.0.1"
frame:traverseNat = true
; node bin location = /usr/bin/node
; node version = v19.7.0
; npm local prefix = /home/piranna/github/Mafalda/ROPE-server-CLI
; npm version = 9.5.0
; cwd = /home/piranna/github/Mafalda/ROPE-server-CLI
; HOME = /home/piranna
; Run `npm config ls -l` to show all defaults.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the case using the sibling packages, restored package.json and package-lock.json, then run npm pack and tar -t as described. Trace how npm pack resolves bundleDependencies when the package is absent from package-lock.json and dependencies; done means the bundled dependency appears in the generated tarfile.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100