npm2yarn was open-sourced as part of our Yarn-ifying Mixmax blog post, which goes into detail about why we decided to move to Yarn, how we did it, and what we learned along the way.
npm2yarn to ensure that we updated our projects correctly throughout our 75-project sweep of Yarnification.
- Checks out the
- Pulls the latest changes
- Checks out a new branch,
yarnify, overwriting any existing
npm-shrinkwrap.jsonif it exists
npm-shrinkwrapif it exists, updating
npm-shrinkwrap-checkif it exists, updating
node_modulesto avoid any installation conflicts
- Installs your project dependencies using Yarn, generating a
yarn checkto ensure that your dependencies were installed correctly (check out our blog post if you encounter any issues in this step)
yarn testas a sanity check
- Stages the changes made
- Logs a list of manual steps to be taken to complete the transition
This conversion will likely involve the upgrading of some/many of your transitive dependencies, so make sure to test thoroughly! :)
$ yarn global add npm2yarn
$ npm install -g npm2yarn
(in the directory of the project to convert, which must be a Git repository)
Check out our Yarn-ifying Mixmax blog post for details on the issues we came across while transitioning to Yarn and how we solved them.
If you're having trouble with the script, please file an issue and we'll check it out!
We welcome your pull requests! Please lint your code.
- 1.0.0 Add initial code