选择命令行版本:
🌐 Description
npm-shrinkwrap.json 是由 npm shrinkwrap 创建的一个文件。它和 package-lock.json 完全一样,不过有一个主要的区别:不同于 package-lock.json,npm-shrinkwrap.json 在发布包时可能会被包含进去。
npm-shrinkwrap.json 推荐用于通过注册中心的发布流程部署的应用:例如,作为全局安装的守护进程和命令行工具,或 devDependencies。强烈不建议库作者发布此文件,因为这会阻止终端用户对传递性依赖的更新进行控制。
🌐 The recommended use-case for npm-shrinkwrap.json is applications deployed through the publishing process on the registry: for example, daemons and command-line tools intended as global installs or devDependencies. It's strongly discouraged for library authors to publish this file, since that would prevent end users from having control over transitive dependency updates.
如果包根目录中同时存在 package-lock.json 和 npm-shrinkwrap.json,则会优先使用 npm-shrinkwrap.json 而不是 package-lock.json 文件。
🌐 If both package-lock.json and npm-shrinkwrap.json are present in a package root, npm-shrinkwrap.json will be preferred over the package-lock.json file.
有关 npm-shrinkwrap.json 文件格式的完整细节和说明,请参阅 package-lock.json 的手册页。
🌐 For full details and description of the npm-shrinkwrap.json file format, refer to the manual page for package-lock.json.
🌐 See also