Skip to content

fix/openssl-node-error - #132

Open
anktiwari053 wants to merge 6 commits into
meabhisingh:masterfrom
anktiwari053:master
Open

fix/openssl-node-error#132
anktiwari053 wants to merge 6 commits into
meabhisingh:masterfrom
anktiwari053:master

Conversation

@anktiwari053

Copy link
Copy Markdown

🔥 Short version (if PR field small ho)

Fixed OpenSSL compatibility issue causing npm start failure in Node.js 22 by using legacy OpenSSL provider.
<img width="1920" height="1080" alt="Screenshot 2026-05-14 212836" src="https://github.com/user-attachments/assets/fd3443a8-01db-455e-8402-9fd624fb33e4" />

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

Copy link
Copy Markdown

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 updates the package-lock.json to version 3 and removes a trailing newline in backend/server.js. Feedback indicates that the lockfile version update does not resolve the OpenSSL compatibility issues mentioned in the PR description; it is recommended to use the --openssl-legacy-provider flag instead. Additionally, a suggestion was made to restore the trailing newline in the server file to maintain POSIX compliance.

Comment thread package-lock.json
"name": "ecommerce",
"version": "1.0.0",
"lockfileVersion": 1,
"lockfileVersion": 3,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The update to lockfileVersion: 3 is a standard migration when using newer npm versions, but it does not resolve the OpenSSL compatibility issue (e.g., ERR_OSSL_EVP_UNSUPPORTED) mentioned in the PR title and description. To fix this in Node.js 17+ (including Node 22), you typically need to enable the legacy provider by adding --openssl-legacy-provider to your Node.js execution command in package.json (e.g., "start": "node --openssl-legacy-provider backend/server.js") or by setting the NODE_OPTIONS environment variable. Please verify that the actual fix is included in the PR.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the review @gemini-code-assist

You’re right — updating lockfileVersion to 3 does not address the OpenSSL compatibility issue (ERR_OSSL_EVP_UNSUPPORTED).

I’ll update the PR to include the proper fix using the --openssl-legacy-provider flag in the start script (or via NODE_OPTIONS) and re-test it to confirm the issue is resolved.

Also noted about the trailing newline in backend/server.js — I’ll restore it to follow POSIX best practices.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for the update, @anktiwari053. That sounds like the correct approach to address the OpenSSL compatibility issue. Please ensure that the package.json changes are included in your next commit so the environment is correctly configured for Node.js 17+.

Comment thread backend/server.js Outdated
process.exit(1);
});
});
}); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The trailing newline at the end of the file was removed. It is a best practice to maintain a single newline at the end of all source files to ensure compatibility with POSIX standards and various development tools.

Suggested change
});
});
References
  1. Source files should end with a single trailing newline character to ensure compatibility with POSIX tools and consistent behavior across different editors.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@gemini-code-assist Thank you for the feedback. I reviewed the issue, restored the trailing newline at the end of the file, and pushed the fix.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for the update, anktiwari053. I have verified that the trailing newline has been restored.

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.

1 participant