[英]With same nodejs version and yarn.lock, install frozen-lockfile works on Ubuntu but fail on Mac
This is my understanding of how yarn
nodejs package management works 这是我对yarn
nodejs包管理工作方式的理解
yarn.lock
declares the exact version of packages installed on your project. yarn.lock
声明项目中安装的软件包的确切版本。 This list of package is independent of OS. 该软件包列表独立于OS。 yarn.lock
file include: 影响将添加到yarn.lock
文件具体内容的yarn.lock
包括:
package.json
file package.json
文件 -> Current OS doesn't affect what package is put inside yarn.lock
when you run yarn install
->当前的操作系统不影响在运行yarn install
时将什么程序包放入yarn.lock
What I did: 我做了什么:
yarn install
on Ubuntu 14.04 -> generates yarn.lock
在Ubuntu 14.04上运行yarn install
yarn.lock
>生成yarn.lock
yarn.lock
onto a Mac machine 将此yarn.lock
复制到Mac机器上 nodejs
version as the one on Ubuntu 14.04, run yarn install --frozen-lockfile
在Ubuntu 14.04上使用相同的nodejs
版本,运行yarn install --frozen-lockfile
And the the installation fails. 并且安装失败。 But when I use a different version of nodejs
on Mac, running yarn install --frozen-lockfile
works. 但是,当我在Mac上使用不同版本的nodejs
时,运行yarn install --frozen-lockfile
。
So does this mean with: 所以这意味着:
yarn.lock
file 相同的yarn.lock
文件 nodejs
相同的nodejs
one CAN'T GUARANTEED the installation would work across all OS? 一个不能保证安装可以在所有OS上正常工作吗?
yarn.lock
it won't work 100% on other platforms until unless all dependencies support cross platforms 除非所有依赖项都支持跨平台,否则yarn.lock
在其他平台上将无法100%工作
Just checked my yarn.lock
they add some dependencies based on an operating system in my case it was is-windows
module added 刚检查我的yarn.lock
他们添加了一些基于操作系统的依赖关系,在我的情况下,这是添加的is-windows
模块
Check all your packages are supported for cross platforms because sometimes many packages are platform specific, You can check all dependencies on packages.json of that package 检查跨平台是否支持所有软件包,因为有时许多软件包是特定于平台的,因此您可以检查该软件包对packages.json的所有依赖关系
OR 要么
Do not push yarn.lock
if you use the application on different operating systems. 如果您在不同的操作系统上使用该应用程序,请不要推动yarn.lock
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.