Can yarn and npm be used by several developers in one project?

I work in a team of about 20 other developers. All our projects use npm packages, and currently all our developers work with npm to manage these packages. I am very curious about the yarn and whether it is installed on my machine. However, I'm nervous to actually use it to install packages in case it spins a project for other developers.

My question is: can one developer use yarn in a project, and other developers use npm in the same repo? From what I read, Yarn uses the same package.json file to get its dependencies. We ignore node_modules in our repo, however we use npm shrinkwrap to block dependencies. I know that Yarn has a Yarn.lock file, and this is where my problem is. Has anyone tried to launch yarn regardless of their team and what problems did you encounter?

+5
npm package-managers yarnpkg
source share
1 answer

Yarn cannot be read by npm-shrinkwrap.json . It generates its own yarn.lock . Although you use yarn, a project in your environment may have a different version of dependencies than your teammates. However, it is safe to try to spin in your own environment, as it does not overwrite the shrinkwrap file and does not affect other developers.

+5
source share

All Articles