Skip to content

Commit 7a3d83a

Browse files
mldangeloclaude
andcommitted
fix: improve Node.js installation recommendations based on official best practices
Update installation instructions to follow current official recommendations and best practices for 2025: macOS: - Remove MacPorts (less commonly recommended, incorrect command) - Prioritize Homebrew > nvm > Official installer - Remove version-specific package confusion Ubuntu/Debian: - Reorder to prioritize NodeSource (recommended for production) - Add warning that snap auto-updates can cause issues in production - Note that default apt repository may be outdated Windows: - Prioritize official installer (most recommended) - Add LTS version options for winget, Chocolatey, and Scoop - Reorder: Official installer > winget > Chocolatey > Scoop All recommendations now align with official Node.js documentation and current community best practices verified through research of official sources. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 9872af3 commit 7a3d83a

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

src/promptfoo/instructions.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,17 @@ def _get_debian_instructions(env: Environment) -> list[str]:
211211
if env.has_sudo:
212212
lines.extend(
213213
[
214-
"Option 1 - Install from default repository:",
215-
" sudo apt update",
216-
" sudo apt install -y nodejs npm",
217-
"",
218-
"Option 2 - Install from NodeSource (recommended, newer version):",
214+
"Option 1 - Install from NodeSource (recommended for production):",
219215
" curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -",
220216
" sudo apt install -y nodejs",
221217
"",
222-
"Option 3 - Install using snap:",
218+
"Option 2 - Install from default repository (may be outdated):",
219+
" sudo apt update",
220+
" sudo apt install -y nodejs npm",
221+
"",
222+
"Option 3 - Install using snap (not recommended for production):",
223223
" sudo snap install node --classic",
224+
" # Note: Snap auto-updates can cause unexpected behavior",
224225
]
225226
)
226227
else:
@@ -350,15 +351,13 @@ def _get_macos_instructions() -> list[str]:
350351
"Option 1 - Homebrew (recommended):",
351352
" brew install node",
352353
"",
353-
"Option 2 - MacPorts:",
354-
" sudo port install nodejs",
355-
"",
356-
"Option 3 - nvm (Node Version Manager):",
354+
"Option 2 - nvm (Node Version Manager, for version management):",
357355
" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash",
358356
" source ~/.zshrc # or ~/.bashrc",
359357
" nvm install 20",
360358
"",
361-
"Option 4 - Download installer from https://nodejs.org/",
359+
"Option 3 - Official installer:",
360+
" Download from https://nodejs.org/",
362361
]
363362

364363

@@ -367,17 +366,20 @@ def _get_windows_instructions() -> list[str]:
367366
return [
368367
"WINDOWS INSTALLATION:",
369368
"",
370-
"Option 1 - winget (Windows 10+):",
371-
" winget install OpenJS.NodeJS",
369+
"Option 1 - Official installer (recommended):",
370+
" Download from https://nodejs.org/",
372371
"",
373-
"Option 2 - Chocolatey:",
374-
" choco install nodejs",
372+
"Option 2 - winget (Windows 10/11, built-in):",
373+
" winget install OpenJS.NodeJS.LTS # For LTS version",
374+
" # or: winget install OpenJS.NodeJS # For current version",
375375
"",
376-
"Option 3 - Scoop:",
377-
" scoop install nodejs",
376+
"Option 3 - Chocolatey:",
377+
" choco install nodejs-lts # For LTS version",
378+
" # or: choco install nodejs # For current version",
378379
"",
379-
"Option 4 - Download installer:",
380-
" https://nodejs.org/",
380+
"Option 4 - Scoop:",
381+
" scoop install nodejs-lts # For LTS version",
382+
" # or: scoop install nodejs # For current version",
381383
]
382384

383385

tests/test_instructions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,9 @@ def test_macos_instructions(self) -> None:
260260

261261
assert "MACOS" in instructions
262262
assert "brew install node" in instructions
263-
assert "MacPorts" in instructions
263+
assert "Official installer" in instructions
264264
assert "nvm" in instructions
265+
assert "nodejs.org" in instructions
265266

266267

267268
class TestWindowsInstructions:

0 commit comments

Comments
 (0)