Skip to content
Jonathan Sharpe edited this page Feb 8, 2020 · 4 revisions

The starter kit is set up to use NPM, but you can switch over to Yarn if you'd prefer. Don't mix and match, this will cause confusion (e.g. Heroku will complain: Two different lockfiles found: package-lock.json and yarn.lock).

Switching to Yarn

  1. Install Yarn
  2. Delete the package-lock.json file (and, if you've npm installed already, node_modules/)
  3. Add an entry in the "engines" section of the package.lock file to include the version of Yarn you're using e.g. "yarn": "1.21.1" (especially if using Heroku, see Specifying a Yarn Version)
  4. Run yarn to install the dependencies and build the yarn.lock file
  5. Update the scripts object in package.json to use yarn instead of npm to run commands, e.g. switch "prebuild": "npm run cleanup", to "prebuild": "yarn cleanup",
  6. [If using Travis] see Using yarn for the changes to make to .travis.yml
  7. [If using Cloud Foundry] check in the buildpack releases that the version of Yarn you want to use matches the version available in the buildpack, which is specified in manifest.yml
  8. Commit and push all of your changes
Clone this wiki locally