npm package-lock drift is treated as fresh when root dependencies changed #964
|
In the reproduction below, Environment$ aube --version
1.24.0 linux-x64 (2026-06-23)ReproductionCreate a new directory and generate a real npm lockfile for mkdir aube-package-lock-drift-repro
cd aube-package-lock-drift-repro
cat > package.json <<'JSON'
{
"name": "aube-package-lock-drift-repro",
"version": "1.0.0",
"private": true,
"dependencies": {
"@raycast/api": "^1.104.13"
}
}
JSON
npm install --package-lock-only --ignore-scriptsAt this point, npm creates a real {
"packages": {
"": {
"dependencies": {
"@raycast/api": "^1.104.13"
}
},
"node_modules/@raycast/api": {
"version": "1.104.20",
"dependencies": {
"@types/node": "22.19.17",
"@types/react": "19.0.10",
"react": "19.0.0"
}
}
}
}Then change only {
"name": "aube-package-lock-drift-repro",
"version": "1.0.0",
"private": true,
"dependencies": {
"@vicinae/api": "^0.21.5"
}
}Run this command with the stale npm lockfile still present. aube install --lockfile-onlyActual behaviorThe lockfile is treated as fresh even though the manifest dependency is Expected behavior
Workaround
aube install --fix-lockfile --ignore-scriptsAfter running that command, The wording above was refined with AI translation/editing, but all testing and observations were performed by me. |
Replies: 1 comment
|
Thanks for the clear repro. I opened PR #974 to fix this. The fix preserves root dependency specifiers from npm I also added regression coverage for the reported case. This comment was generated by Codex. |
Thanks for the clear repro. I opened PR #974 to fix this.
The fix preserves root dependency specifiers from npm
package-lock.jsonentries, so the existing drift checker can now see whenpackage.jsonhas moved from@raycast/apito@vicinae/api. With that,aube install --lockfile-onlyshould re-resolve instead of reporting the stale lockfile as fresh, andaube install --frozen-lockfileshould fail on the mismatch.I also added regression coverage for the reported case.
This comment was generated by Codex.