Skip to content

Conversation

@vellanki-santhosh
Copy link

Summary

Fixes #5670 - Starting a local server fails with ReferenceError: File is not defined

Root Cause

The undici HTTP client (bundled with cheerio) requires the global File class, which is only available in Node.js v20+. Node.js 18.x does not provide File globally, causing the crash on startup.

Changes

Version Requirements

  • package.json: Updated engines.node from >=18.15.0 <19.0.0 || ^20 to >=20.0.0
  • GitHub Actions CI: Updated to test with Node.js 20.0.0

Documentation Updates

  • Updated all README files (EN, JA, KR, TW, ZH) with Node.js >= 20.0.0 requirement
  • Added comprehensive Troubleshooting: Node.js Version section including:
    • NVM upgrade instructions (recommended)
    • NodeSource APT installation (alternative)
    • Cleanup guide for old Node.js versions
    • pm2 and systemd service setup for background running
    • Nginx reverse proxy configuration
    • HTTPS (Let's Encrypt) and authentication setup

Breaking Change

⚠️ Node.js 18.x is no longer supported. Users must upgrade to Node.js v20 or later.

Testing

After upgrading to Node.js v20+:

npm install -g flowise
npx flowise start

Server should start correctly at http://localhost:3000 without the File is not defined error.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @vellanki-santhosh, 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 addresses a critical runtime error by enforcing a higher Node.js version requirement, specifically Node.js v20 or later. It significantly enhances the project's documentation to guide users through the necessary environment setup, including detailed instructions for upgrading Node.js and configuring various deployment scenarios like background services, reverse proxies, and authentication.

Highlights

  • Node.js Version Requirement: The minimum required Node.js version has been updated from 18.15.0 to 20.0.0 to resolve a ReferenceError: File is not defined issue caused by the undici HTTP client (used by cheerio) requiring the global File class, which is only available in Node.js v20+.
  • Breaking Change: Node.js 18.x is no longer supported. Users must upgrade their Node.js environment to version 20 or later to run the application.
  • Documentation Enhancement: All README files (English, Japanese, Korean, Traditional Chinese, Simplified Chinese) have been updated to reflect the new Node.js requirement. A comprehensive 'Troubleshooting: Node.js Version' section has been added to the main README, providing detailed instructions for upgrading Node.js using NVM or NodeSource, cleaning up old versions, and setting up the application as a background service (pm2, systemd), with Nginx reverse proxy, HTTPS, and authentication configurations.
  • CI Updates: The GitHub Actions CI configuration has been updated to test the application with Node.js 20.0.0, ensuring compatibility with the new minimum version.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/main.yml
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 correctly addresses the File is not defined error by enforcing Node.js v20+, which is a necessary breaking change. The accompanying documentation updates are thorough and very helpful for users, especially the new troubleshooting section in the main README.md.

My review includes a suggestion to improve the robustness of the provided systemd service configuration by removing a hardcoded Node.js version. Additionally, to improve the experience for non-English speaking users, I've recommended adding links in the translated README files that point to the detailed troubleshooting guide in the English version. Overall, this is a great contribution that will resolve a critical startup issue for many users.

README.md Outdated
Comment on lines 164 to 165
Environment="PATH=/home/YOUR_USERNAME/.nvm/versions/node/v20.18.0/bin:/usr/bin:/bin"
ExecStart=/home/YOUR_USERNAME/.nvm/versions/node/v20.18.0/bin/npx flowise start
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The systemd service file hardcodes a specific Node.js version (v20.18.0) in Environment and ExecStart. This is brittle and will fail if a user has a different patch version of Node.js installed via nvm. It also requires manual updates to the service file whenever Node.js is updated.

A more robust approach is to remove the hardcoded paths and use nvm within the service to manage the Node.js environment. This makes the service file independent of the specific patch version.

I suggest replacing the Environment and ExecStart lines with a single ExecStart that sources the nvm.sh script. This will use the default Node.js version configured with nvm, which the user is instructed to set to v20 earlier in the documentation.

Suggested change
Environment="PATH=/home/YOUR_USERNAME/.nvm/versions/node/v20.18.0/bin:/usr/bin:/bin"
ExecStart=/home/YOUR_USERNAME/.nvm/versions/node/v20.18.0/bin/npx flowise start
ExecStart=/bin/bash -c 'export NVM_DIR="/home/YOUR_USERNAME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && npx flowise start'

## ⚡ クイックスタート

[NodeJS](https://nodejs.org/en/download) >= 18.15.0 をダウンロードしてインストール
[NodeJS](https://nodejs.org/en/download) >= 20.0.0 をダウンロードしてインストール
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While the Node.js version requirement has been updated, the detailed troubleshooting guide from the English README.md is missing. To help users who might face issues with upgrading Node.js, it would be beneficial to add a link to the troubleshooting section in the main README.md.

Suggested change
[NodeJS](https://nodejs.org/en/download) >= 20.0.0 をダウンロードしてインストール
[NodeJS](https://nodejs.org/en/download) >= 20.0.0 をダウンロードしてインストール
Node.js のバージョンに関する問題が発生した場合は、[英語の README にあるトラブルシューティングのセクション](../README.md#troubleshooting-nodejs-version) を参照してください。

## ⚡빠른 시작 가이드

18.15.0 버전 이상의 [NodeJS](https://nodejs.org/en/download) 다운로드 및 설치
20.0.0 버전 이상의 [NodeJS](https://nodejs.org/en/download) 다운로드 및 설치
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While the Node.js version requirement has been updated, the detailed troubleshooting guide from the English README.md is missing. To help users who might face issues with upgrading Node.js, it would be beneficial to add a link to the troubleshooting section in the main README.md.

Suggested change
20.0.0 버전 이상의 [NodeJS](https://nodejs.org/en/download) 다운로드 및 설치
20.0.0 버전 이상의 [NodeJS](https://nodejs.org/en/download) 다운로드 및 설치
Node.js 버전 관련 문제가 발생하면 [영어 README의 문제 해결 섹션](../README.md#troubleshooting-nodejs-version)을 참조하세요.

## ⚡ 快速開始

下載並安裝 [NodeJS](https://nodejs.org/en/download) >= 18.15.0
下載並安裝 [NodeJS](https://nodejs.org/en/download) >= 20.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While the Node.js version requirement has been updated, the detailed troubleshooting guide from the English README.md is missing. To help users who might face issues with upgrading Node.js, it would be beneficial to add a link to the troubleshooting section in the main README.md.

Suggested change
下載並安裝 [NodeJS](https://nodejs.org/en/download) >= 20.0.0
下載並安裝 [NodeJS](https://nodejs.org/en/download) >= 20.0.0
如果遇到 Node.js 版本問題,請參閱[英文版 README 的故障排除部分](../README.md#troubleshooting-nodejs-version)

## ⚡ 快速入门

下载并安装 [NodeJS](https://nodejs.org/en/download) >= 18.15.0
下载并安装 [NodeJS](https://nodejs.org/en/download) >= 20.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While the Node.js version requirement has been updated, the detailed troubleshooting guide from the English README.md is missing. To help users who might face issues with upgrading Node.js, it would be beneficial to add a link to the troubleshooting section in the main README.md.

Suggested change
下载并安装 [NodeJS](https://nodejs.org/en/download) >= 20.0.0
下载并安装 [NodeJS](https://nodejs.org/en/download) >= 20.0.0
如果遇到 Node.js 版本问题,请参阅[英文版 README 的故障排除部分](../README.md#troubleshooting-nodejs-version)

BREAKING CHANGE: Node.js 18.x is no longer supported

The undici HTTP client (bundled with cheerio) requires the global File
class which is only available in Node.js v20+. This fixes the
ReferenceError: File is not defined crash on startup.

Changes:
- Update engines.node in package.json to >=20.0.0
- Update GitHub Actions CI to test with Node.js 20.0.0
- Update all README files (EN, JA, KR, TW, ZH) with new requirement
- Add troubleshooting links in translated READMEs to English docs
- Add comprehensive troubleshooting section with:
  - NVM upgrade instructions (recommended)
  - NodeSource APT installation (alternative)
  - Cleanup guide for old Node.js versions
  - pm2 and systemd service setup (using NVM sourcing for future-proof paths)
  - Nginx reverse proxy configuration
  - HTTPS (Let's Encrypt) and authentication setup

Fixes FlowiseAI#5670
@vellanki-santhosh vellanki-santhosh force-pushed the fix/node-version-requirement branch from e57e0aa to c005d90 Compare January 24, 2026 16:26
@vellanki-santhosh
Copy link
Author

PR Review Responses

Systemd Service File

Thanks for catching that! I’ve updated the systemd service example to source nvm.sh instead of hardcoding the Node.js path. This ensures compatibility across patch versions and future upgrades.

Translated README Files

Good point. I’ve added references in JA, KR, TW, and ZH README files pointing to the English troubleshooting section so users can find detailed upgrade instructions regardless of language.

Testing Confirmation

Verified locally with Node.js v20.18.0 and CI runs successfully. Flowise starts without the File is not defined error.

Final Note

All requested changes have been applied. Documentation is consistent across languages, and the service file is now future‑proof. This PR is ready to merge.

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