tools: add package-lock when installing npm dependency#49747
tools: add package-lock when installing npm dependency#49747marco-ippolito wants to merge 4 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
8d1b700 to
c86c349
Compare
|
cc: @nodejs/build @nodejs/tsc for visibility |
|
Can you execute the script and commit the package-lock so we see how it looks like? |
This reverts commit 8a8551a.
|
8a8551a |
|
I'm not convinced of the benefits of adding ALL that extra metadata to the repo, given that the deps are already checked in. Are there other less-obvious benefits? |
|
Have all the infos to make the installation repeatable, check whats in the dependency tree |
|
Why would we need to make the installation repeatable using npm rather than git? |
|
Probably the package lock is a bit misleading. |
@aduh95 the issue is that if we have to make a change in the future to fix a CVE that may require building from the |
|
Adding to TSC agenda so I can address any remaining questions/comments since we had questions from a few TSC members. |
|
so the package-lock doesn't match with the package because of the way the package is generated:
the right way would be download the directly acorn-walk (as tar, zip) without going through npm installation, and therefore without needing a package-lock, so it might be required to change the update script |
For reference, the package-lock.json from that commit looks like this: {
"name": "acorn-walk-tmp",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "acorn-walk-tmp",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"acorn-walk": "^8.2.0"
},
"engines": {
"npm": "10.1.0"
}
},
"node_modules/acorn-walk": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
"engines": {
"node": ">=0.4.0"
}
}
}
}The point I was raising in yesterday's TSC meeting was that this looks very odd -- |
|
I will close this PR and create another one to change the update script |
PR-URL: nodejs#50413 Refs: nodejs#49747 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Adding package lock with npm version when installing a dependency with npm.
This allow us to have a better view of what we are installing
Refs: nodejs/security-wg#1037
If we agree on this I'll do for the rest of npm deps