使用 Git
锁文件
¥Lockfiles
你应该始终提交锁定文件 (pnpm-lock.yaml
)。造成这种情况的原因有很多,其中最主要的是:
¥You should always commit the lockfile (pnpm-lock.yaml
). This is for a
multitude of reasons, the primary of which being:
-
由于能够跳过包解析,它可以更快地安装 CI 和生产环境
¥it enables faster installation for CI and production environments, due to being able to skip package resolution
-
它在开发、测试和生产环境之间强制执行一致的安装和解决方案,这意味着测试和生产中使用的包将与开发项目时完全相同
¥it enforces consistent installations and resolution between development, testing, and production environments, meaning the packages used in testing and production will be exactly the same as when you developed your project