Conversation
There was a problem hiding this comment.
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_PATHhas 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.
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 |
There was a problem hiding this comment.
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).



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-25Docker build image and updates run scripts to executeapp/main.jsvia absolute paths while settingNODE_PATHto the bundlednode_modulesfor more reliable module resolution.Written by Cursor Bugbot for commit eb0c7e4. This will update automatically on new commits. Configure here.