-
Notifications
You must be signed in to change notification settings - Fork 73
Yarn
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
).
- Install Yarn
- Delete the
package-lock.json
file (and, if you'venpm install
ed already,node_modules/
) - Add an entry in the
"engines"
section of thepackage.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) - Run
yarn
to install the dependencies and build theyarn.lock
file - Update the
scripts
object inpackage.json
to useyarn
instead ofnpm
to run commands, e.g. switch"prebuild": "npm run cleanup",
to"prebuild": "yarn cleanup",
-
[If using Travis] see Using yarn for the changes to make to
.travis.yml
-
[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
- Commit and push all of your changes