Yarn and npm (version> = 3.0.0) should be relatively compatible, especially moving from npm to yarn, since compatibility is one of the stated goals of yarn . As stated in Migrating with npm :
Yarn can use the same package.json format as npm, and can install any package from the npm registry.
So, theoretically, any package.json that is valid for npm should also work equally well for yarn. Note that I'm saying npm v2 is probably less compatible - this is because npm is moved from the nested node_modules structure to a flat layout (which is what Yarn uses). However, yarn and npm v3 should create very similar layouts because, as stated in the release, I'm connected :
As a first approximation, we should try to be very compatible with the node_modules layout for people who need this compatibility, because this will be the most likely way to avoid long tail problems.
However, you cannot use the Yarn.lock generated by Yarn, because (as the name implies) it is only supported with Yarn, and npm shrinkwrap incompatible.
In addition, as @RyanZim notes, older versions of Yarn do not support pre-and post-install hooks , but versions than v0.16.1 . If you rely on these hooks, you will need to tell users that versions greater than v0.16.1 .
In general, as long as you do not encounter errors and use only the functions that are shared by package managers, you should not have any problems.
Aurora0001
source share