package-locks
npm lockfiles的解释
描述
从概念上讲,"input" 到 npm install
是一个 package.json,而它的 "output" 是一个完整的 node_modules
树:您声明的依赖关系的表示。在理想情况下,npm 会像纯函数一样工作:相同的 package.json
应该随时生成完全相同的 node_modules
树。在某些情况下,这确实是真的。但在许多其他情况下,npm 无法做到这一点。这有多种原因:
可能使用了不同版本的 npm(或其他包管理器)来安装包,每个包使用的安装算法略有不同。
自上次安装包以来,可能已经发布了直接 semver-range 包的新版本,因此将使用更新的版本。
wGIGgiZDyRhWj05JjA9PCRy1f8LwSfQ0qfl2c6X3bBUoOL+7pR2GGjmKD17mP61X0eolnZD15agSwPGIV04bY0A9n8097mfXtP07f1mi4fsmxSg8WQjOKNlUtD5G69KxIlzPbSz3+u178EJecdYao1ol7ZbR+jsSSi4y8DXbpeoQmb0aIj2lRFVCnxOHL5nlzhKGe+U7ZcXtrDUuuzmG86RU9WfuoGxuMTttYat9HekM2JmQ9CsaAtTVzpSQWr8B
XHX6G6+WSUKIC2NUDffZVkONH1AGG/BnxcuNKJj8+83r7eqdkCGoYbMcxMfFuj75yNiejhetFipXA4MP3NzWNIJZTjv59XX+JFkAKaH0cVglE4NSj31uV52DkpYJfUy/i2X8pLCuYWi19qj1V7UDDFMAaO37ijKdlwMni594P6l9GB27V5r+zKU3L+GJv0Fk8ISBcbuA4L0JOSSrSzJWKQ==
cykKbJXHRprbkGrCMfCF/49/hVcewl57VqgzB7w84eQ=
{
"name": "A",
"version": "0.1.0",
"dependencies": {
"B": "<0.1.0"
}
}
pOWAhP9KxtO3xZiOG01dEg==
{
"name": "B",
"version": "0.0.1",
"dependencies": {
"C": "<0.1.0"
}
}
P7HHSHJTbV96hrDfpmwhBw==
{
"name": "C",
"version": "0.0.1"
}
9pDyuhnG1oVETJhX2a94snbyzQGXX+ebZcZlCO387cPcBELTqINtyf3fxOZLye9v633Ik0MuHaqXOsTPsFOmaep52qMbPTBKInRuvDvOdLtO8Cg/lXpZRAlB7BrCWXKHdqVPjYmOL1Z2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LtNRQ17Mg/Bm52PxpAHlJHdtsKAYH2WM9zguR3drfJRqHfZ6J0uxBB934kbGTOWXGw7F
r3XuZ289vC9rEpCkaEg4p87YNLKVyoBuqmjH8N8CU//TUa3MqfU9IzBFnO7FHlVxYFryWSAjNeb8qsaS0n9XGrVe/nERC8NgZIz9rWVhxLgD2xAzORW0bgB3/fq7dlYQj0XtsNfX8FnV3dlLQMljEQ==
{
"name": "A",
"version": "0.1.0",
...metadata fields...
"dependencies": {
"B": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/B/-/B-0.0.1.tgz",
"integrity": "sha512-DeAdb33F+"
"dependencies": {
"C": {
"version": "git://github.com/org/C.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4"
}
}
}
}
}
CeIo9TyTETByJbxXyB/D0p500N1EMZD4rShAw0oLxN/nWpJ3v8TzSUuDGkrCRLlzBLeFZBSi6yarxiF4SXNJzm7srV8LfH5un97QWv95l1pDcIuvlM0oeqHFKZS9caCB7bBxJzh7KtIpTcu1JsTd8FgVH9+A7yjaaj4OeXkZFk+aiQm5ExwmFoe0fqozfYiabF6ZzAulnaXy94Nf46ljP8IGclGBl8yHwh9L+LCpjUV7id4C+4wOQ1OI+6MRqAkH5dZKdD3O2tgHLJIdT934KNYjlk2ZFaHeFbl0ArWVdD3iVJA5R9B3P+nfwbtcvVxF3+xb1lxtVYSGmEK4pGOGpAzvQoJku2iCAGth5PsDcT0=
2/IjHPUqkvmNjIJqYfE/per9k1o8ioN+d0r2dph6FJkBKPXA4J1QRg3Pl+m9gfz1rN9h6CQiVC1mkPls4IbGXg==
erwSV/FJymCv7LsrPg+2ff7btEDjSU6slFGd3b3QzXgJoQvfYguh6X/n3+Bms9bQk62tOwEPDghPXBmh4jDuaeSbY7WarW0F0dw+6U6On+0D9A9n32sA+YzSTtocq6J3WfwvGy0B6c/SsAGioRno+5qhaJQU0Xz8eyVRfe8uMR4exvUjkbxevQW/GkaTv30jWnlIyg2Gmka++uEYGvbm0WghozqJ/sqN03ZfkoH2ngqpmnTHMNTltE41pWbmoGaZykxeVImbumgC5TPNUTPOWw==
Hky/4bXFQQAgVRBKLfOk4wIB7J12exU6S6/olUsCbMxeWiu4AMhjqgQGBazoD1ncajejTrUe4sxfoINyGstghA==
ohOgAyTPm8zGKJj1tXwmca3trgaBmoFS8KHVJFMowu//s04ONVqAMttGvKB7GEgG8QMWtJqKjCHLBLvfew8nOnPVrM05p4HVRksb9H64qCb/njW7a5duwRp9/mZxIMTjig5/UeB/UcQ3d2HkaBs/P80x6lHq1NkD91GeNfS9dr86IsRPivkqMYTp1Q2OUyWtCE3WGlVYlaUcT5e46rVrlknLiMxqUvF4sjGCbv4h72p+w4oHMASdgpLOyAy9Rc2GCWVzN7jKAvOHyOwtypledjLFE/GdjzGvliDF+tKpJhyGE7pLnpgad+74fgSRsomt80Iiq2z7OT3L5TszpOJ4yFF5O1me4wG3wvfb1TwmuONy+p49C6+6aA17rdE2wwoOJnOJQu/dktejUh1Qq78aeIkV/mfZUxZZZxRncBb0Q08WqdAC1qxHJPUGOa6j0Zl2/6Y0Woti16aDWrAWIlmDoXxiI1IokO5Ejk+2D5knvkXUKb/EahoiPIrVvyKbgiPnADFyXL4EGJPqDe4+yzilf5FpxpSp69bcOCNOUDrhnjWmXVlPiVtAzpw4TxeKebFDuUPSqNVdBPLiiPq4cW2P1sMmcwj1ZTCRw0FECIPu8go=
"scripts": {
"postshrinkwrap": "json -I -e \"this.myMetadata = $MY_APP_METADATA\""
}
使用锁定的包
fy0Ep5ymrnoduuV8IuHiVzY3aiZLD/Gjkj9to4ht6Q/eMeu6o3di0aA5RQwoVm7NWaNoPFMqe2KRuwhDvz7/IRhsMwE2ptMgyeuNozw+rc4dNg60yhy1bujRnb+6sttpCUF244ZQX8l+aKuK0NvVC9sKQywZsQfLoia2zJIMkae6hbYM2MhbvULws7MgIM9VQYyF0oZ7wPyAZRN5DhG/eU77LuS3V3X20bwC6agmcNiK3MCiKSzTFtmkc84xkEQHWktux4J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