2022-08-12 npm ci / yarn --frozen-lockfile
npm ci
npm ciというコマンドがある。
This command is similar to npm install, except it’s meant to be used in automated environments such as test platforms, continuous integration, and deployment
npm installと違い CI で走るように特化したコマンドで、npm installよりも高速だ。
actions/setup-node の場合
github actions の actions/setup-node の場合も npm ciを使うようになっている。
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: npm test
actions/setup-node: Set up your GitHub Actions workflow with a specific version of node.js
yarn –frozen-lockfile
yarn の場合どうか?
npm ci相当のコマンドは下記のコマンドになる。
$ yarn install --frozen-lockfile