Skip to content

CC-2146: Upgrade node to v25#101

Merged
andy1li merged 1 commit intomainfrom
andy/upgrade-node-to-v25
Mar 8, 2026
Merged

CC-2146: Upgrade node to v25#101
andy1li merged 1 commit intomainfrom
andy/upgrade-node-to-v25

Conversation

@andy1li
Copy link
Member

@andy1li andy1li commented Mar 8, 2026

CC-2146: Upgrade node to v25


Note

Medium Risk
Upgrades the execution environment from Node 21 to Node 25 and adjusts entrypoint scripts, which could surface runtime or dependency compatibility issues in user solutions and CI containers.

Overview
Upgrades the JavaScript starter and solution environments to Node.js 25, updating codecrafters.yml/template requirements and docs to match.

Adds a nodejs-25 Docker build image and updates run scripts to execute app/main.js via absolute paths while setting NODE_PATH to the bundled node_modules for more reliable module resolution.

Written by Cursor Bugbot for commit eb0c7e4. This will update automatically on new commits. Configure here.

@linear
Copy link

linear bot commented Mar 8, 2026

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: NODE_PATH has no effect with ES modules
    • Removed NODE_PATH from all shell scripts as it's ignored by ES module resolution, which automatically walks up parent directories to find node_modules.

Create PR

Or push these changes by commenting:

@cursor push 46304192a0
Preview (46304192a0)
diff --git a/compiled_starters/javascript/.codecrafters/run.sh b/compiled_starters/javascript/.codecrafters/run.sh
--- a/compiled_starters/javascript/.codecrafters/run.sh
+++ b/compiled_starters/javascript/.codecrafters/run.sh
@@ -8,5 +8,4 @@
 
 set -e # Exit on failure
 
-NODE_PATH="$(dirname "$0")/node_modules" \
 exec node "$(dirname "$0")/app/main.js" "$@"
\ No newline at end of file

diff --git a/compiled_starters/javascript/your_program.sh b/compiled_starters/javascript/your_program.sh
--- a/compiled_starters/javascript/your_program.sh
+++ b/compiled_starters/javascript/your_program.sh
@@ -12,5 +12,4 @@
 #
 # - Edit this to change how your program runs locally
 # - Edit .codecrafters/run.sh to change how your program runs remotely
-NODE_PATH="$(dirname "$0")/node_modules" \
 exec node "$(dirname "$0")/app/main.js" "$@"

diff --git a/starter_templates/javascript/code/.codecrafters/run.sh b/starter_templates/javascript/code/.codecrafters/run.sh
--- a/starter_templates/javascript/code/.codecrafters/run.sh
+++ b/starter_templates/javascript/code/.codecrafters/run.sh
@@ -8,5 +8,4 @@
 
 set -e # Exit on failure
 
-NODE_PATH="$(dirname "$0")/node_modules" \
 exec node "$(dirname "$0")/app/main.js" "$@"
\ No newline at end of file


exec node app/main.js "$@"
NODE_PATH="$(dirname "$0")/node_modules" \
exec node "$(dirname "$0")/app/main.js" "$@" No newline at end of file
Copy link

Choose a reason for hiding this comment

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

NODE_PATH has no effect with ES modules

Medium Severity

The newly added NODE_PATH environment variable is ignored by Node.js when resolving ES modules. Since package.json declares "type": "module", all .js files use the ESM resolver, which does not consult NODE_PATH (it only works with CommonJS require()). If the intent is to help Node find node_modules in a non-standard location, this setting silently does nothing, and users who add npm dependencies may encounter module-not-found errors if node_modules isn't discoverable through standard ESM resolution (walking up parent directories from the importing file).

Additional Locations (2)

Fix in Cursor Fix in Web

@andy1li andy1li merged commit 79a9e8d into main Mar 8, 2026
20 of 23 checks passed
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.

1 participant