Skip to content

NodeJS kit crashes on startup due to deprecated bodyParser() usage and missing dependencies #14

@amanjagdev

Description

@amanjagdev

Description

The NodeJS integration kit in its current state fails to start on modern Node.js environments due to two critical issues:

1. Deprecated bodyParser() call crashes the server

In main.js, the middleware is initialized as:

app.use(bodyParser());

This form was removed in body-parser v2+ and deprecated long before that. It throws a TypeError: bodyParser is not a function or similar error, preventing the server from starting.

Fix: Replace with the explicit middleware calls:

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

2. Missing dependencies in package.json

express and body-parser are required in main.js but were never listed in package.json. Running npm install from a clean clone does not install them, causing require() to fail.

3. No .gitignore

node_modules/ and .env (which contains secrets like EASEBUZZ_KEY and EASEBUZZ_SALT) have no .gitignore entry, risking accidental commit of sensitive data and bloating the repo.

Steps to Reproduce

  1. Clone the repo
  2. cd Easebuzz_NodeJS_kit && npm install
  3. node main.js
  4. Server crashes immediately

Expected Behavior

Server starts and listens on port 3000.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions