.nvmrc ファイルとは?
.nvmrc ファイルの解説。何をするものか、そして CI/CD でなぜ重要かを含みます。
.nvmrc ファイルは、nvm と互換ツール向けに単一の Node.js バージョン文字列を含みます。
何であるか
プロジェクトが期待する Node のバージョンを宣言し、開発者と CI が同じものを使えるようにします。
CI/CD でなぜ重要か
CI では、actions/setup-node が node-version-file を介して .nvmrc を読み取れるため、runner が正確なバージョンを使い、バージョン不一致のバグを避けられます。
重要なポイント
- .nvmrc は Node のバージョンを固定します。
- setup-node はそれを読み取れます。
- ローカルと CI の Node を同期させます。
関連ガイド
What Is actions/checkout in GitHub Actions?actions/checkout is the official action that clones your repository onto the runner so subsequent steps can b…
What Is a GitHub Actions Runner?A runner is the machine that executes a GitHub Actions job. It can be GitHub-hosted, self-hosted, or a manage…
What Is Node.js? The JavaScript Runtime ExplainedNode.js explained: what the JavaScript runtime is, how the event loop works, a small example, its central rol…