fix/openssl-node-error - #132
Conversation
There was a problem hiding this comment.
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.
| "name": "ecommerce", | ||
| "version": "1.0.0", | ||
| "lockfileVersion": 1, | ||
| "lockfileVersion": 3, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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+.
| process.exit(1); | ||
| }); | ||
| }); | ||
| }); No newline at end of file |
There was a problem hiding this comment.
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.
| }); | |
| }); | |
References
- Source files should end with a single trailing newline character to ensure compatibility with POSIX tools and consistent behavior across different editors.
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
Thank you for the update, anktiwari053. I have verified that the trailing newline has been restored.
🔥 Short version (if PR field small ho)