reactjsnpmreact-slingshot

Why does react slingshot repo uses both, Npm and yarn?


I was taking a look at the react slingshot starter kit and I couldn't understand why the project uses npm and yarn at the same time.

The repo's url is: https://github.com/coryhouse/react-slingshot

Can someone give me an explanation about that?

I heard that if you have yarn.lock (as the project does) you should use yarn. However all the command line commands are based on npm. Why?


Solution

  • The package-lock.json is to support installing dependencies with NPM 5x +.

    The yarn.lock is to support for people installing dependencies with Yarn.

    With this package, they are now required to commit both because they are actively supporting both package managers.

    My opinion is that they only need to commit one, as they run the risk of lock files becoming out of sync, so its one convenience at the cost of another.

    Maybe I'm missing something obvious but I wouldn't recommend taking this approach to anyone starting a new project or package. 1 package manager is enough