SAP-samples / SAP-samples/codejam-code-based-agents
JavaScript track: npm install can resolve an incompatible @langchain/core, even though the committed lockfile is fine
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 54
- Forks
- 36
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Summary
package.json (both starter-project and solution) pins:
json "@langchain/core": "1.1.39", "@langchain/langgraph": "1.2.8",
The committed package-lock.json resolves @langchain/langgraph-checkpoint (a transitive dependency of @langchain/langgraph) to 1.0.1, which is compatible with @langchain/core@1.1.39. So the lockfile itself is internally consistent.
The problem: the exercises instruct learners to run npm install, not npm ci. npm install can re-resolve transitive dependencies against whatever's currently newest on the npm registry rather than strictly honoring the lockfile. @langchain/langgraph-checkpoint has since published newer versions (currently 1.1.3) that require @langchain/core: ^1.1.48 — incompatible with the exact 1.1.39 pin. A fresh npm install today resolves to this newer, incompatible version.
Effect
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './utils/uuid' is not defined by "exports" in .../node_modules/@langchain/core/package.json imported from .../@langchain/langgraph/node_modules/@langchain/langgraph-checkpoint/dist/id.js
thrown immediately on npx tsx src/basicAgent.ts (or any entry point importing @langchain/langgraph), since @langchain/core@1.1.39 doesn't yet expose the ./utils/uuid export subpath that the newer langgraph-checkpoint@1.1.3 needs.
Suggested fix
Either:
- Bump the pinned
@langchain/coreversion inpackage.jsonto something satisfying^1.1.48(e.g.1.1.49or later), removing the fragility of the exact pin against a moving transitive dependency, or - Have learners run
npm ciinstead ofnpm installin the exercise instructions, so the exact working dependency tree from the committed lockfile is used rather than a fresh, potentially-drifted resolution (tradeoff: learners then don't get any newer patch versions of pinned packages).
Option 1 is more robust long-term, since this kind of drift will keep recurring as the npm ecosystem publishes new versions over time, regardless of the lockfile.
Environment
Reproduced on a personal SAP AI Core tenant, JavaScript/TypeScript track, npm install run fresh in starter-project/ (not npm ci), Node.js v24.18.0.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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.
Línea de trabajo
Comienza con package.json tanto en starter-project como en solution, el package-lock.json confirmado y las instrucciones del ejercicio para la instalación de dependencias. Reproduce el problema con un npm install nuevo en starter-project y, después, ejecuta npx tsx src/basicAgent.ts para confirmar el fallo. La tarea estará completada cuando ambas configuraciones del ejercicio utilicen un árbol de dependencias compatible y el punto de entrada se ejecute sin el package export error.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- build-system
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Activo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 76/100