The review step runs `npm ci` inside an npm workspace package, silently deleting the rest of the monorepo's dependencies
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- tooling
Línea de trabajo
Empieza por la instrucción de reinstalación congelada en src/programs/posthog-integration/agent/review.md y luego lee la instalación específica de npm y el manejo de workspaces a los que hace referencia el issue. Comprueba cómo el paso de revisión elige su comando de instalación y si el npm ci --dry-run sugerido encaja en ese flujo. Se considera terminado cuando la comprobación de revisión de npm detecte discrepancias en el archivo de bloqueo sin eliminar dependencias de otros paquetes del workspace.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened
I ran the wizard (3.0.0) on an npm workspaces monorepo with --install-dir apps/web. The repo has one package-lock.json and one node_modules at the root, shared tools (typescript, @biomejs/biome, @playwright/test) as root devDependencies, and four workspace packages (apps/web, apps/server, apps/desktop, packages/shared).
During Verify and review the integration, the agent ran these from apps/web:
npm add posthog-js@1
npm ci # "npm's clean lockfile install check before compilation"
npm run build # passed
npm run typecheck # sh: tsc: command not found
Afterwards the root node_modules held only apps/web's dependency graph. typescript, @biomejs/biome, @playwright/test, electron and the other workspace links were gone. package-lock.json was unchanged, so git status showed nothing. Running npm install at the root restored everything.
The run summary said "verified a clean npm ci" and reported the typecheck as "unavailable because typescript is not declared in this package".
Why
src/programs/posthog-integration/agent/review.md asks for a frozen re-install after the last install:
After your last install, run the project's install once more without changing the lockfile (
pnpm install --frozen-lockfileor its equivalent)
On npm the equivalent is npm ci, and with cd unavailable it runs in the workspace package. There npm scopes the command to that one package. npm ci deletes node_modules, then reinstalls only that package's dependencies. pnpm and yarn install the whole workspace from a sub-folder, so they don't have this problem.
The agent couldn't have worked around it:
- The
integration-buildskill says to work only inside the project folder. bash-fence.tsrefuses directory flags that point outside it, sonpm --prefix <root> ciisn't possible.- The agent's own detection ran from
apps/weband saw a single-package repo, although the wizard's discovery had loggedrepoType=monorepoanddetect_package_managerreported "the workspace lockfile is in ".
Minimal reproduction (npm 11.19.0, Node 24, macOS)
mkdir repro && cd repro && git init -q
cat > package.json <<'EOF'
{ "name": "repro", "private": true, "workspaces": ["apps/*"], "devDependencies": { "is-number": "7.0.0" } }
EOF
mkdir -p apps/web apps/api
echo '{ "name": "@repro/web", "version": "1.0.0", "private": true, "dependencies": { "ms": "2.1.3" } }' > apps/web/package.json
echo '{ "name": "@repro/api", "version": "1.0.0", "private": true, "dependencies": { "left-pad": "1.3.0" } }' > apps/api/package.json
npm install
ls node_modules # @repro is-number left-pad ms
(cd apps/web && npm ci --dry-run) # "up to date", nothing removed
(cd apps/web && npm ci)
ls node_modules # @repro ms <- is-number, left-pad and @repro/api are gone
Suggested fix
On npm, use npm ci --dry-run for the frozen re-check. It runs the same lockfile sync check as npm ci: when package.json and package-lock.json disagree, it fails with EUSAGE … Missing: <pkg> from lock file. It never deletes node_modules, it is safe from any workspace folder, and the bash fence already allows it.
It is weaker than a real npm ci in one way: a dry run downloads nothing and runs no install scripts, so a package whose download or install script would fail on a fresh install gets past it. On npm that gap is small: the npm add just before it had already downloaded the same packages and run their scripts. npm 11's allowScripts policy, its counterpart to pnpm's ignored build scripts, applies to that npm add as well, so a refused install script would show up there rather than in the dry run. Closing the gap would take a real npm ci from the workspace root. bash-fence.ts refuses directory flags outside the project folder, and that command would reinstall the whole monorepo.
the project's install once more without changing the lockfile (`pnpm install
---frozen-lockfile` or its equivalent): if it fails on a package this run added, that package
+--frozen-lockfile`, `npm ci --dry-run` on npm, or its equivalent): if it fails on a package this run added, that package
does not fit.
Happy to test a fix against the same monorepo.
- Lenguaje dominante
- TypeScript
- Estrellas
- 208
- Forks
- 58
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 76
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin 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 PostHog/wizard
-
wizard --version prints unknown when run through npxPosiblemente ocupada @bryanlundberg la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
PostHog/wizard#1460 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
-
Self-driving setup: checkbox labels and Confirm button overlap wrapped description textQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PostHog/wizard#986 · 4 comentarios ·
Los mantenedores suelen responder en 2 días
-
Intro shows "(detected)" after a manual pick from the detection-failed pickerPosiblemente ocupada @ShobhanKarthish la tomó hace 87 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
Todos los issues de PostHog/wizard
Issues similares
-
Amélioration du résumé regAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
MTES-MCT/monitorenv#3257 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
salesforce/sa11y#1022 ·
-
area/web platform/ios type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
anomalyco/opencode#67504 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Kartographer map markers lose their geo: link on non-English wikisPosiblemente ocupada @playlikeboy la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
openzim/mwoffliner#3014 ·
Los mantenedores suelen responder en 1 día
-
Report: Bloomberg HTAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día