Skip to content

Add devcontainer config to pin Node version from .nvmrc#1626

Merged
jakecoffman merged 2 commits intomainfrom
copilot/update-node-version-in-codespace
Feb 27, 2026
Merged

Add devcontainer config to pin Node version from .nvmrc#1626
jakecoffman merged 2 commits intomainfrom
copilot/update-node-version-in-codespace

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Codespaces launches with a newer Node than .nvmrc specifies. Added devcontainer configuration to install and default to the .nvmrc version.

  • Adds .devcontainer/devcontainer.json with a postCreateCommand that runs nvm install (reads .nvmrc), sets the default alias, and installs npm dependencies

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Node version in codespace to match .nvmrc Add devcontainer config to pin Node version from .nvmrc Feb 27, 2026
@jakecoffman jakecoffman marked this pull request as ready for review February 27, 2026 18:50
@jakecoffman jakecoffman requested a review from a team as a code owner February 27, 2026 18:50
Copilot AI review requested due to automatic review settings February 27, 2026 18:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds devcontainer configuration to ensure GitHub Codespaces uses the Node.js version specified in .nvmrc (20.9.0) instead of a newer default version. This aligns the Codespaces development environment with the Node version used in CI workflows and local development.

Changes:

  • Adds .devcontainer/devcontainer.json with a postCreateCommand to install the correct Node version and dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,3 @@
{
"postCreateCommand": "nvm install && nvm alias default $(cat .nvmrc) && npm install"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The postCreateCommand is missing nvm use between nvm install and npm install. After installing the Node version, you need to activate it with nvm use before running npm commands. The README.md (line 31) shows the established pattern: nvm install;nvm use. Without this, npm install may run with a different Node version than intended. Consider updating to: nvm install && nvm use && nvm alias default $(cat .nvmrc) && npm install

Suggested change
"postCreateCommand": "nvm install && nvm alias default $(cat .nvmrc) && npm install"
"postCreateCommand": "nvm install && nvm use && nvm alias default $(cat .nvmrc) && npm install"

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,3 @@
{
"postCreateCommand": "nvm install && nvm alias default $(cat .nvmrc) && npm install"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The devcontainer configuration uses npm install but the project consistently uses npm clean-install everywhere else (test.yml:23, check-dist.yml:24, dependabot-build.yml:52, integration-test.yml:23). Using npm clean-install (or npm ci) ensures a clean, reproducible installation from package-lock.json, which is the established convention in this repository.

Suggested change
"postCreateCommand": "nvm install && nvm alias default $(cat .nvmrc) && npm install"
"postCreateCommand": "nvm install && nvm alias default $(cat .nvmrc) && npm clean-install"

Copilot uses AI. Check for mistakes.
@jakecoffman jakecoffman merged commit f87224f into main Feb 27, 2026
13 checks passed
@jakecoffman jakecoffman deleted the copilot/update-node-version-in-codespace branch February 27, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants