Skip to content

Add clear nvm + Node.js installation instructions and reusable setup script - #1

Merged
JohnDaWalka merged 1 commit into
releasefrom
copilot/fix-ef465ce0-5fd4-4015-bd4f-76e729fce3b8
Sep 10, 2025
Merged

Add clear nvm + Node.js installation instructions and reusable setup script#1
JohnDaWalka merged 1 commit into
releasefrom
copilot/fix-ef465ce0-5fd4-4015-bd4f-76e729fce3b8

Conversation

Copilot AI commented Sep 10, 2025

Copy link
Copy Markdown

Expands the existing "Install Node.js" step in the README with comprehensive nvm installation instructions and adds a reusable setup script to help contributors quickly satisfy the plugin's Node.js requirement.

Changes Made

Enhanced README.md

  • Added a new subsection "Installing Node.js via nvm" under step 2 with an anchor link #install-node-with-nvm
  • Provides minimal setup commands using nvm v0.40.3 and Node.js 24
  • Includes a convenient one-liner for quick installation
  • Shows how to pin exact versions (e.g., 24.7.0) for reproducibility
  • Adds troubleshooting tips about shell profile configuration and avoiding curly quotes
  • References the new helper script for automated setup

New Helper Script

  • Created scripts/install-node.sh with executable permissions
  • Bash script that idempotently installs or updates nvm and Node.js
  • Uses NODE_VERSION environment variable (defaults to 24) for flexibility
  • Includes proper error handling with set -euo pipefail
  • Outputs node and npm versions for verification
  • Can be run as: bash scripts/install-node.sh or NODE_VERSION=24.7.0 bash scripts/install-node.sh

Benefits

  • Copy-paste ready: Users can now quickly set up Node.js without guessing
  • No sudo required: nvm provides isolated, per-user installation
  • Version pinning: Supports both latest and exact version specification
  • Automation: Helper script enables reproducible setup in CI/development environments
  • Backwards compatible: Existing users are unaffected, new content is additive only

The enhanced instructions provide a reliable path for new contributors while maintaining the existing step numbering and structure.

This pull request was created as a result of the following prompt from Copilot chat.

Add clear nvm + Node.js installation instructions and a reusable setup script to the repository so contributors can quickly satisfy the plugin's Node.js requirement.

Context:
The current README only lists step 2 as: "Install Node.js." This can be expanded to give users a reliable, copy/paste set of commands using nvm (widely used, avoids requiring sudo, and allows version pinning). We will:

Planned changes:

  1. README.md
    • Augment Step 2 (Install Node.js) with a new subsection "Installing Node.js via nvm" containing:
      • Minimal commands:
        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
        . "$HOME/.nvm/nvm.sh"
        nvm install 24
        node -v
        npm -v
      • Note about optionally pinning an exact version (e.g. 24.7.0) for reproducibility.
      • One-liner form.
      • Troubleshooting note: ensure shell profile sources nvm, and avoid curly quotes.
      • Brief LTS vs current comment (encouraging contributors to match whatever version is documented if changed later).
    • Provide a link anchor so future docs can reference it (#install-node-with-nvm).
  2. New script: scripts/install-node.sh
    • Bash script to install (or update) nvm and install a specified Node version (default 24) idempotently.
    • Safe, POSIX-friendly, with NODE_VERSION environment override.
    • Echo resulting node and npm versions.

Script contents (proposed):

#!/usr/bin/env bash
set -euo pipefail

: "${NODE_VERSION:=24}"
NVM_VERSION="v0.40.3"
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"

if [ ! -s "$NVM_DIR/nvm.sh" ]; then
echo "[install-node] Installing nvm $NVM_VERSION ..." >&2
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash
fi

shellcheck source=/dev/null

. "$NVM_DIR/nvm.sh"

if ! nvm ls "$NODE_VERSION" >/dev/null 2>&1; then
echo "[install-node] Installing Node $NODE_VERSION ..." >&2
nvm install "$NODE_VERSION"
fi
nvm alias default "$NODE_VERSION" >/dev/null
nvm use "$NODE_VERSION" >/dev/null

echo "[install-node] node: $(node -v)" >&2
echo "[install-node] npm: $(npm -v)" >&2

echo "Node environment ready."

README insertion example (markdown snippet to add under Step 2):

Installing Node.js via nvm

If you do not already have Node.js, we recommend using nvm for an isolated, per-user install.

Minimal setup:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
. "$HOME/.nvm/nvm.sh"
nvm install 24
node -v
npm -v

One-liner:

export NVM_DIR="$HOME/.nvm"; [ -s "$NVM_DIR/nvm.sh" ] || curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash; . "$NVM_DIR/nvm.sh"; nvm install 24; node -v; npm -v

Exact version (for reproducibility) – replace with latest 24.x if desired:

nvm install 24.7.0
nvm alias default 24.7.0

Troubleshooting: Make sure your shell profile (e.g. ~/.bashrc or ~/.zshrc) contains the lines the installer appends so nvm is available in new shells. Avoid using curly quotes.

Helper script:
You can also run: bash scripts/install-node.sh (optionally NODE_VERSION=24.7.0 bash scripts/install-node.sh).

Acceptance criteria:

  • README.md updated with the above subsection without disrupting existing numbering and content.
  • New directory scripts/ (if not present) containing install-node.sh (executable bit set) with the provided logic.
  • No other files changed.
  • Markdown passes basic lint (no trailing spaces, fenced code blocks correct).

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@JohnDaWalka
JohnDaWalka marked this pull request as ready for review September 10, 2025 14:30
Copilot AI review requested due to automatic review settings September 10, 2025 14:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JohnDaWalka
JohnDaWalka merged commit 947d8b9 into release Sep 10, 2025
1 check passed
Copilot AI changed the title [WIP] Add nvm-based Node.js installation instructions and setup script Add clear nvm + Node.js installation instructions and reusable setup script Sep 10, 2025
Copilot AI requested a review from JohnDaWalka September 10, 2025 14:38

@JohnDaWalka JohnDaWalka left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

traceroute to nathanielbass.com (198.49.23.145), 30 hops max, 60 byte packets
1 gateway (172.31.1.1) 4.304 ms 4.830 ms 4.954 ms
2 32775.your-cloud.host (168.119.223.78) 2.131 ms 2.150 ms 2.176 ms
3 * * *
4 * * *
5 spine15.cloud1.nbg1.hetzner.com (213.133.127.26) 2.769 ms 2.769 ms 2.765 ms
6 core11.nbg1.hetzner.com (213.239.239.121) 3.011 ms core11.nbg1.hetzner.com (213.239.203.101) 0.738 ms 0.714 ms
7 core41.vie.hetzner.com (213.239.237.209) 9.026 ms core41.vie.hetzner.com (213.239.237.213) 8.552 ms 8.510 ms

Repository owner locked and limited conversation to collaborators Sep 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants