Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch nan in Top-Level node_modules Directory #167

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

gdavidkov
Copy link
Contributor

This pull request includes a modification to the tools/updatenan.js script to improve its reliability on different platforms. The key change is the addition of a check to ensure the correct path to the nan.h file is used, depending on its existence.

Improvements to script reliability:

  • tools/updatenan.js: Added existsSync to check for the existence of the nan.h file and adjusted the path accordingly for Windows platforms.

@agracio
Copy link
Owner

agracio commented Nov 6, 2024

Could you explain how nan can end up outside of node_modules, I am missing something?
Oh I see that would happen in a project that has electron-edge-js as dependency.

@agracio
Copy link
Owner

agracio commented Nov 6, 2024

Please trigger Build All GitHub workflow on your branch. https://github.com/gdavidkov/electron-edge-js/actions/workflows/build-all.yml

@gdavidkov
Copy link
Contributor Author

Could you explain how nan can end up outside of node_modules, I am missing something? Oh I see that would happen in a project that has electron-edge-js as dependency.

The reason nan can end up outside of electron-edge-js’s node_modules folder is due to dependency hoisting. When multiple packages in a project rely on the same version of nan, package managers like npm or yarn may "hoist" it to the top-level node_modules to prevent duplicate installations.

One potential solution is to fork nan and modify it according to electron-edge-js’s specific requirements. You could then use your custom version as a direct dependency of your project, ensuring it stays compatible with electron-edge-js. This approach allows full control over the version and configuration of nan, and you can update the fork as needed.

@agracio agracio merged commit 0c2cede into agracio:master Nov 7, 2024
0 of 20 checks passed
@agracio
Copy link
Owner

agracio commented Nov 7, 2024

Should be released later today

@agracio
Copy link
Owner

agracio commented Nov 7, 2024

Released

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.

2 participants