Fix #5670: Starting a local server fails#5816
Fix #5670: Starting a local server fails#5816danielalanbates wants to merge 1 commit intoFlowiseAI:mainfrom
Conversation
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>
Summary of ChangesHello @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
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| 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) |
There was a problem hiding this comment.
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.
| 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 } | |
| ) |
Fixes #5670
Summary
This PR addresses: Starting a local server fails
Changes
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).