Maintaining yarn.lock cross-platform? Maintaining yarn.lock cross-platform? docker docker

Maintaining yarn.lock cross-platform?


Not really an answer but...

Your example is not an issue specific to yarn, yarn.lock or npm and package-lock.json for that matter. The fsevents package is specifically for MacOS file system events. As such, it won't work on any other platform (e.g. Linux).

If you are using this package directly, you may want to consider a replacement that is cross-platform.

If this warning is coming up because of a dependency to your project, you may want to make sure that it (and it's dependencies) are cross-platform as well.

Oftentimes platform-specific packages exist to make up for a feature that is either incompatible or not present on that platform. So long as you (or your dependency) are handling this correctly, in a per-platform way, you should be fine. These packages are listed in package.json as optional because they are expected to fail on platforms they are not designed for (hence the warning).

For more information on this, Yarn has a good explanation of dependency types which includes optional dependencies:

This is useful for dependencies that won’t necessarily work on every machine and you have a fallback plan in case they are not installed...

https://yarnpkg.com/lang/en/docs/dependency-types/