Skip to content

Node.js 25.2.1, 24.11.1, 22.21.1, and 20.19.5#27

Merged
N6REJ merged 2 commits intomainfrom
November
Dec 15, 2025
Merged

Node.js 25.2.1, 24.11.1, 22.21.1, and 20.19.5#27
N6REJ merged 2 commits intomainfrom
November

Conversation

@jwaisner
Copy link
Copy Markdown
Contributor

@jwaisner jwaisner commented Nov 23, 2025

PR Type

Enhancement


Description

  • Add Node.js versions 25.2.1, 24.11.1, 22.21.1, and 20.19.5

  • Create launch scripts and configuration files for each version

  • Configure npm paths and npmrc settings per Node.js version

  • Update bundle release date to 2025.11.23


Diagram Walkthrough

flowchart LR
  A["Node.js Versions<br/>25.2.1, 24.11.1<br/>22.21.1, 20.19.5"] --> B["launch.bat<br/>scripts"]
  A --> C["bearsampp.conf<br/>configuration"]
  A --> D["npmrc files<br/>npm settings"]
  B --> E["Environment setup<br/>npm config"]
  C --> E
  D --> E
Loading

File Walkthrough

Relevant files
Configuration changes
17 files
launch.bat
Launch script for Node.js 20.19.5                                               
+12/-0   
launch.bat
Launch script for Node.js 22.21.1                                               
+12/-0   
launch.bat
Launch script for Node.js 24.11.1                                               
+12/-0   
launch.bat
Launch script for Node.js 25.2.1                                                 
+12/-0   
bearsampp.conf
Configuration file for Node.js 20.19.5                                     
+8/-0     
bearsampp.conf
Configuration file for Node.js 22.21.1                                     
+8/-0     
bearsampp.conf
Configuration file for Node.js 24.11.1                                     
+8/-0     
bearsampp.conf
Configuration file for Node.js 25.2.1                                       
+8/-0     
npmrc
NPM configuration for Node.js 20.19.5                                       
+4/-0     
npmrc.ber
NPM template configuration for Node.js 20.19.5                     
+4/-0     
npmrc
NPM configuration for Node.js 22.21.1                                       
+4/-0     
npmrc.ber
NPM template configuration for Node.js 22.21.1                     
+4/-0     
npmrc
NPM configuration for Node.js 24.11.1                                       
+4/-0     
npmrc.ber
NPM template configuration for Node.js 24.11.1                     
+4/-0     
npmrc
NPM configuration for Node.js 25.2.1                                         
+4/-0     
npmrc.ber
NPM template configuration for Node.js 25.2.1                       
+4/-0     
build.properties
Update bundle release date to 2025.11.23                                 
+1/-1     

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented Nov 23, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
No auditing: The launch scripts add configuration and invoke Node/npm without emitting any audit logs
for critical actions, but given these are setup scripts this may be acceptable depending
on broader system logging.

Referred Code
ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%

"%BEARSAMPP_NODEJS_PATH%\nodevars.bat" & "%BEARSAMPP_NODEJS_PATH%\npm" config set globalconfig "%BEARSAMPP_NODEJS_CONFIG_PATH%" --global

ENDLOCAL

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Missing error handling: The batch script executes environment setup and npm config without checking exit codes or
handling failures, which may be acceptable for simple bootstrap scripts depending on
installer context.

Referred Code
"%BEARSAMPP_NODEJS_PATH%\nodevars.bat" & "%BEARSAMPP_NODEJS_PATH%\npm" config set globalconfig "%BEARSAMPP_NODEJS_CONFIG_PATH%" --global

ENDLOCAL

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented Nov 23, 2025

PR Code Suggestions ✨

Latest suggestions up to 50c9b92

CategorySuggestion                                                                                                                                    Impact
Possible issue
Ensure batch chaining and quoting

Fix the batch script by using call to chain script executions, quoting paths in
SET commands, and using parentheses and quotes for file redirection to prevent
failures with special characters in paths.

bin/nodejs25.2.1/launch.bat [4-10]

-SET BEARSAMPP_NODEJS_PATH=%~dp0
-SET BEARSAMPP_NODEJS_PATH=!BEARSAMPP_NODEJS_PATH:~0,-1!
-SET BEARSAMPP_NODEJS_NPM_PATH=%BEARSAMPP_NODEJS_PATH%\node_modules\npm
-SET BEARSAMPP_NODEJS_CONFIG_PATH=%BEARSAMPP_NODEJS_NPM_PATH%\npmrc
-ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%
+SET "BEARSAMPP_NODEJS_PATH=%~dp0"
+SET "BEARSAMPP_NODEJS_PATH=!BEARSAMPP_NODEJS_PATH:~0,-1!"
+SET "BEARSAMPP_NODEJS_NPM_PATH=%BEARSAMPP_NODEJS_PATH%\node_modules\npm"
+SET "BEARSAMPP_NODEJS_CONFIG_PATH=%BEARSAMPP_NODEJS_NPM_PATH%\npmrc"
+(ECHO prefix = %BEARSAMPP_NODEJS_PATH%) > "%BEARSAMPP_NODEJS_CONFIG_PATH%"
 
-"%BEARSAMPP_NODEJS_PATH%\nodevars.bat" & "%BEARSAMPP_NODEJS_PATH%\npm" config set globalconfig "%BEARSAMPP_NODEJS_CONFIG_PATH%" --global
+call "%BEARSAMPP_NODEJS_PATH%\nodevars.bat"
+call "%BEARSAMPP_NODEJS_PATH%\npm.cmd" config set globalconfig "%BEARSAMPP_NODEJS_CONFIG_PATH%" --global
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies and fixes multiple critical bugs in the batch script, including unquoted paths and incorrect script chaining, which would cause failures in common scenarios.

High
Quote file redirection paths

Fix the file redirection on line 8 by quoting the target path and using
parentheses for the ECHO command to ensure it works correctly with paths
containing spaces.

bin/nodejs22.21.1/launch.bat [4-8]

 SET BEARSAMPP_NODEJS_PATH=%~dp0
 SET BEARSAMPP_NODEJS_PATH=!BEARSAMPP_NODEJS_PATH:~0,-1!
 SET BEARSAMPP_NODEJS_NPM_PATH=%BEARSAMPP_NODEJS_PATH%\node_modules\npm
 SET BEARSAMPP_NODEJS_CONFIG_PATH=%BEARSAMPP_NODEJS_NPM_PATH%\npmrc
-ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%
+(ECHO prefix = %BEARSAMPP_NODEJS_PATH%) > "%BEARSAMPP_NODEJS_CONFIG_PATH%"
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a critical bug where unquoted path redirection would fail if the path contains spaces, and provides a robust fix.

Medium
Separate global and user config

In the npmrc file, change the userconfig path to a user-specific location like
${USERPROFILE}\.npmrc to avoid conflicts and permission issues with the global
configuration.

bin/nodejs25.2.1/etc/npmrc [1-4]

 cache = ~BEARSAMPP_WIN_PATH~\tmp\npm-cache
 globalconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\npmrc
 init-module = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\.npm-init.js
-userconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\npmrc
+userconfig = ${USERPROFILE}\.npmrc
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a design issue where userconfig points to a file in the installation directory, which is not ideal, and proposes a more standard configuration.

Medium
  • More

Previous suggestions

✅ Suggestions up to commit a80670c
CategorySuggestion                                                                                                                                    Impact
High-level
Avoid duplication by generating version-specific files

To improve scalability and reduce maintenance, generate version-specific
configuration files and scripts from a common template using a build-time
script. This avoids duplicating files for each new Node.js version.

Examples:

bin/nodejs20.19.5/etc/npmrc [1-4]
cache = ~BEARSAMPP_WIN_PATH~\tmp\npm-cache
globalconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs20.19.5\etc\npmrc
init-module = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs20.19.5\etc\.npm-init.js
userconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs20.19.5\etc\npmrc
bin/nodejs22.21.1/etc/npmrc [1-4]
cache = ~BEARSAMPP_WIN_PATH~\tmp\npm-cache
globalconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs22.21.1\etc\npmrc
init-module = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs22.21.1\etc\.npm-init.js
userconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs22.21.1\etc\npmrc

Solution Walkthrough:

Before:

// bin/nodejs20.19.5/etc/npmrc
cache = ~BEARSAMPP_WIN_PATH~\tmp\npm-cache
globalconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs20.19.5\etc\npmrc
...

// bin/nodejs22.21.1/etc/npmrc
cache = ~BEARSAMPP_WIN_PATH~\tmp\npm-cache
globalconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs22.21.1\etc\npmrc
...

// bin/nodejs20.19.5/launch.bat
@ECHO OFF
...
ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%
...

// (This pattern is repeated for all 4 new versions)

After:

// templates/npmrc.tpl
cache = ~BEARSAMPP_WIN_PATH~\tmp\npm-cache
globalconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\{{VERSION}}\etc\npmrc
...

// templates/launch.bat.tpl
@ECHO OFF
...
ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%
...

// build_script (pseudo-code)
versions = ["20.19.5", "22.21.1", ...]
for version in versions:
  render_template("npmrc.tpl", version)
  render_template("launch.bat.tpl", version)
Suggestion importance[1-10]: 9

__

Why: This suggestion addresses a critical architectural flaw in the PR—massive file duplication—and proposes a robust, scalable solution that would significantly improve the project's maintainability.

High
Possible issue
Avoid unintended trailing whitespace in output
Suggestion Impact:Updated the batch script to use parenthesized ECHO with output redirection and a quoted config path, avoiding a trailing space and handling paths with spaces.

code diff:

-ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%
+(ECHO prefix = %BEARSAMPP_NODEJS_PATH%) > "%BEARSAMPP_NODEJS_CONFIG_PATH%"

To prevent writing an unintended trailing space to the configuration file, wrap
the ECHO command in parentheses and quote the destination path.

bin/nodejs20.19.5/launch.bat [8]

-ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%
+(ECHO prefix = %BEARSAMPP_NODEJS_PATH%) > "%BEARSAMPP_NODEJS_CONFIG_PATH%"

[Suggestion processed]

Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a subtle issue with the ECHO command in batch scripts that adds a trailing space to the output file, and provides a standard and correct fix, improving the script's robustness.

Low
Possible issue
Preserve per-user npm config

In the npmrc file, remove the userconfig and globalconfig settings to allow npm
to use its default user configuration, thus preventing conflicts with per-user
settings.

bin/nodejs25.2.1/etc/npmrc [1-4]

 cache = ~BEARSAMPP_WIN_PATH~\tmp\npm-cache
-globalconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\npmrc
 init-module = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\.npm-init.js
-userconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\npmrc
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that forcing userconfig to be the same as globalconfig is problematic as it prevents users from having their own npm configuration, which is a significant usability issue.

Medium
Ensure correct command chaining

In launch.bat, use CALL when invoking nodevars.bat and npm.cmd, and chain them
with && instead of & for better error handling and script control flow.

bin/nodejs25.2.1/launch.bat [10]

-"%BEARSAMPP_NODEJS_PATH%\nodevars.bat" & "%BEARSAMPP_NODEJS_PATH%\npm" config set globalconfig "%BEARSAMPP_NODEJS_CONFIG_PATH%" --global
+CALL "%BEARSAMPP_NODEJS_PATH%\nodevars.bat" ^
+  && CALL "%BEARSAMPP_NODEJS_PATH%\npm.cmd" config set globalconfig "%BEARSAMPP_NODEJS_CONFIG_PATH%" --global
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly points out that using CALL is necessary to return control from the called batch script and && provides better error handling, making the script more robust.

Low
Validate config target exists

In launch.bat, add a check to verify that the %BEARSAMPP_NODEJS_NPM_PATH%
directory exists before writing the npmrc file, and exit with an error if it
does not.

bin/nodejs25.2.1/launch.bat [6-8]

-SET BEARSAMPP_NODEJS_NPM_PATH=%BEARSAMPP_NODEJS_PATH%\node_modules\npm
-SET BEARSAMPP_NODEJS_CONFIG_PATH=%BEARSAMPP_NODEJS_NPM_PATH%\npmrc
+SET "BEARSAMPP_NODEJS_NPM_PATH=%BEARSAMPP_NODEJS_PATH%\node_modules\npm"
+SET "BEARSAMPP_NODEJS_CONFIG_PATH=%BEARSAMPP_NODEJS_NPM_PATH%\npmrc"
+
+IF NOT EXIST "%BEARSAMPP_NODEJS_NPM_PATH%\" (
+  ECHO npm folder not found: "%BEARSAMPP_NODEJS_NPM_PATH%"
+  EXIT /B 1
+)
+
 ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%
Suggestion importance[1-10]: 5

__

Why: This is a good defensive programming suggestion that improves the script's robustness by checking for the existence of a directory before attempting to write a file into it.

Low

Comment thread bin/nodejs20.19.5/launch.bat Outdated
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
@qodo-code-review
Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Path Quoting

The ECHO ... >%BEARSAMPP_NODEJS_CONFIG_PATH% redirection is unquoted in several launch scripts, which can break when the install path contains spaces or special characters. Align the approach across all versions by quoting the redirection target (and/or using a parenthesized ECHO with a quoted file path).

@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET BEARSAMPP_NODEJS_PATH=%~dp0
SET BEARSAMPP_NODEJS_PATH=!BEARSAMPP_NODEJS_PATH:~0,-1!
SET BEARSAMPP_NODEJS_NPM_PATH=%BEARSAMPP_NODEJS_PATH%\node_modules\npm
SET BEARSAMPP_NODEJS_CONFIG_PATH=%BEARSAMPP_NODEJS_NPM_PATH%\npmrc
ECHO prefix = %BEARSAMPP_NODEJS_PATH%>%BEARSAMPP_NODEJS_CONFIG_PATH%

"%BEARSAMPP_NODEJS_PATH%\nodevars.bat" & "%BEARSAMPP_NODEJS_PATH%\npm" config set globalconfig "%BEARSAMPP_NODEJS_CONFIG_PATH%" --global
Config Side Effects

Running npm config set globalconfig ... --global may persist configuration changes beyond the current session (depending on npm’s config precedence and where it writes), potentially affecting other Node/npm installations for the user. Validate that this is intended, and consider scoping to the bundled environment only (or using env vars like NPM_CONFIG_GLOBALCONFIG/NPM_CONFIG_USERCONFIG for the process) to avoid lasting changes.

SET BEARSAMPP_NODEJS_PATH=%~dp0
SET BEARSAMPP_NODEJS_PATH=!BEARSAMPP_NODEJS_PATH:~0,-1!
SET BEARSAMPP_NODEJS_NPM_PATH=%BEARSAMPP_NODEJS_PATH%\node_modules\npm
SET BEARSAMPP_NODEJS_CONFIG_PATH=%BEARSAMPP_NODEJS_NPM_PATH%\npmrc
(ECHO prefix = %BEARSAMPP_NODEJS_PATH%) > "%BEARSAMPP_NODEJS_CONFIG_PATH%"

"%BEARSAMPP_NODEJS_PATH%\nodevars.bat" & "%BEARSAMPP_NODEJS_PATH%\npm" config set globalconfig "%BEARSAMPP_NODEJS_CONFIG_PATH%" --global
npmrc Precedence

The npmrc sets both globalconfig and userconfig to the same file path. This can cause confusing precedence/override behavior and makes it harder to reason about what npm will read/write. Confirm this is intentional and that npm won’t unexpectedly rewrite the bundled etc/npmrc on normal usage.

cache = ~BEARSAMPP_WIN_PATH~\tmp\npm-cache
globalconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\npmrc
init-module = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\.npm-init.js
userconfig = ~BEARSAMPP_WIN_PATH~\bin\nodejs\nodejs25.2.1\etc\npmrc

@N6REJ N6REJ merged commit d95e381 into main Dec 15, 2025
2 checks passed
@N6REJ N6REJ deleted the November branch December 15, 2025 16:46
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.

2 participants