[BUG] bundleDependencies are not installed from a git dependency when the cache path contains a symlink
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
Línea de trabajo
The reproduction compares installing the same commit from an npm pack tarball and a git dependency; start by tracing npm CLI's git dependency install and bundleDependencies handling. Use the provided steps with a package that also declares a registry dependency such as ms, then compare the installed node_modules contents. Done means git installs retain the bundled dep as the tarball install does.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
This is not just a request to bump a dependency for a CVE
- This is not solely a request to bump a dependency for a CVE
Current Behavior
A package commits a bundled dependency (node_modules/dep, listed in bundleDependencies) and also has a regular registry dependency (ms). Installing the package's tarball keeps the bundled dependency. Installing the same commit as a git dependency does not: node_modules/pkg/node_modules does not exist, although the install reports success.
--- install from tarball
dep
--- install from git (same commit)
ls: node_modules/pkg/node_modules: No such file or directory
The registry dependency is the trigger. With "dependencies": { "dep": "1.0.0" } only (no ms), the git install keeps the bundled dep. Scoped bundled names behave the same as unscoped ones.
The tarball in the reproduction is npm pack output of the same commit and contains the bundle, so the bundle is lost during the git install, not when packing.
Expected Behavior
Installing from git installs the bundled dependency, as installing the tarball of the same commit does.
Steps To Reproduce
set -e
rm -rf work-bundle && mkdir work-bundle && cd work-bundle
ROOT=$PWD
# pkg bundles dep: node_modules/dep is committed and listed in bundleDependencies
git init -q pkg && cd pkg
git config user.email a@b && git config user.name a
echo '{"name":"pkg","version":"1.0.0","dependencies":{"dep":"1.0.0","ms":"^2.1.3"},"bundleDependencies":["dep"]}' > package.json
mkdir -p node_modules/dep
echo '{"name":"dep","version":"1.0.0"}' > node_modules/dep/package.json
git add -f . && git commit -qm init && SHA=$(git rev-parse HEAD)
npm pack --pack-destination "$ROOT" >/dev/null 2>&1
cd "$ROOT"
echo '--- install from tarball'
mkdir from-tarball && cd from-tarball && echo '{"private":true}' > package.json
npm install --no-audit --no-fund "$ROOT/pkg-1.0.0.tgz" >/dev/null
ls node_modules/pkg/node_modules
cd "$ROOT"
echo '--- install from git (same commit)'
mkdir from-git && cd from-git && echo '{"private":true}' > package.json
npm install --allow-git=all --no-audit --no-fund "git+file://$ROOT/pkg#$SHA" >/dev/null
ls node_modules/pkg/node_modules 2>&1 || true
Environment
- npm: 12.2.2 (also reproduced with 11.11.0)
- Node.js: 26.13.0
- OS Name: macOS
- System Model Name: Mac
- npm config:
; default config
- Lenguaje dominante
- JavaScript
- Estrellas
- 10.3k
- Forks
- 5k
- Merge medio
- 4 d 11 h
- PR fusionados (30 d)
- 26
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de npm/cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endingsPosiblemente ocupada @saruk-vedant la tomó hace 7 días. AbiertoBug Needs Triage Triage Requested
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
npm/cli#10316 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[BUG] npm pkg delete removes the first array item for a nonexistent propertyPosiblemente ocupada @drawliin la tomó hace 42 días. Abiertocmd:delete Priority 3
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 2 días
-
create node pr: Node.js 20 deprecation & `DEP0040` warnings loggedQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. AbiertoEngineering Priority 1
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
Los mantenedores suelen responder en 2 días
-
`npm audit signatures` does not report how many packages it skipped for want of registry keysPosiblemente ocupada @greenlincoln05 la tomó hace 63 días. AbiertoPriority 3
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
npm/cli#10018 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
Issues similares
-
docs: add SECURITY.md vulnerability reporting policyPosiblemente ocupada @AK-Lmn la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
flisk-sh/linux2wasm#12 ·
Los mantenedores suelen responder en 1 día
-
possible bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Mintplex-Labs/anything-llm#7388 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 60/100
Los mantenedores suelen responder en 1 día
-
v6: Minified bootstrap.min.css is missing header infoPosiblemente ocupada @lazerg la tomó hoy. Abiertobug build confirmed has-pr v6
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
githubnext/gh-aw-workshop#6332 ·
Los mantenedores suelen responder en 1 día