Skip to content

Comments

Fix #5670: Starting a local server fails#5816

Open
danielalanbates wants to merge 1 commit intoFlowiseAI:mainfrom
danielalanbates:fix/issue-5670
Open

Fix #5670: Starting a local server fails#5816
danielalanbates wants to merge 1 commit intoFlowiseAI:mainfrom
danielalanbates:fix/issue-5670

Conversation

@danielalanbates
Copy link

Fixes #5670

Summary

This PR addresses: Starting a local server fails

Changes

package.json                         | 2 +-
 packages/server/package.json         | 2 +-
 packages/server/src/commands/base.ts | 8 ++++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

Testing

Please review the changes carefully. The fix was verified against the existing test suite.


This PR was created with the assistance of Claude Sonnet 4.6 by Anthropic | effort: low. Happy to make any adjustments!

By submitting this pull request, I confirm that my contribution is made under the terms of the project's license (contributor license agreement).

The File Web API used by undici (bundled in cheerio) and the OpenAI SDK
is only available from Node.js v20.0.0 onwards. Running Flowise on
Node.js 18 causes a cryptic `ReferenceError: File is not defined` crash
on startup.

- Update engines.node in both package.json files to ">=20.0.0"
- Add an early runtime check in BaseCommand.init() that prints a clear
  error message and exits with a non-zero code when Node.js < 20 is
  detected

Fixes FlowiseAI#5670

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @danielalanbates, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where the local server failed to start by standardizing the minimum required Node.js version to 20.0.0 across the project. It also introduces a robust runtime validation to prevent the server from launching with incompatible Node.js versions, ensuring a consistent and stable development environment.

Highlights

  • Node.js Version Enforcement: The required Node.js version has been updated across the project's package.json files to >=20.0.0.
  • Runtime Version Check: A new runtime check was introduced in the server's base command to ensure that Node.js v20 or later is being used, providing an error message and exiting if the requirement is not met.
Changelog
  • package.json
    • Updated the 'engines.node' field to specify a minimum Node.js version of '>=20.0.0'.
  • packages/server/package.json
    • Modified the 'engines.node' field to require Node.js '>=20.0.0'.
  • packages/server/src/commands/base.ts
    • Added a check within the init method to verify the Node.js major version.
    • Implemented an error message and process exit if the detected Node.js version is less than 20.
Activity
  • The pull request was created by danielalanbates to fix issue Starting a local server fails #5670, which reported local server startup failures.
  • The author noted that the PR was created with the assistance of Claude Sonnet 4.6 by Anthropic, with low effort.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an issue where the local server fails to start by enforcing a minimum Node.js version of 20. This is achieved by updating the engines field in package.json files and adding a runtime check in the BaseCommand class to ensure the application is run with a compatible Node.js version. The changes are logical and provide a clear error message to users on unsupported versions. The suggested improvement to the runtime check by using an idiomatic approach provided by the oclif framework has been retained as it does not conflict with any provided rules.

Comment on lines +188 to +191
console.error(
`Error: Flowise requires Node.js v20 or later. You are running Node.js v${process.versions.node}.\nPlease upgrade Node.js: https://nodejs.org/`
)
process.exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better integration with the oclif framework, it's more idiomatic to use this.error() to handle this version check failure. This method is designed for reporting errors and exiting in an oclif command, providing consistent error formatting and improving testability by allowing this.error to be mocked. The Error: prefix is not needed as this.error() adds it automatically.

Suggested change
console.error(
`Error: Flowise requires Node.js v20 or later. You are running Node.js v${process.versions.node}.\nPlease upgrade Node.js: https://nodejs.org/`
)
process.exit(1)
this.error(
`Flowise requires Node.js v20 or later. You are running Node.js v${process.versions.node}.\nPlease upgrade Node.js: https://nodejs.org/`,
{ exit: 1 }
)

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.

Starting a local server fails

1 participant