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

Having 'nan' in node_modules causes error with string sub-command FIND #330

Open
sailingKieler opened this issue Apr 10, 2024 · 0 comments

Comments

@sailingKieler
Copy link

sailingKieler commented Apr 10, 2024

Hey devs,
I'm not sure which part of cmake or cmake-js is actual responsible for this, I just try it here for a start:

We're developing project including llvm-bindings that leverages cmake-js, and that contributes native addons to node.js based on node-addon-api.
We have other dependencies that transitively pull NAN.

If NAN is contained in the (root level) node_modules folder, cmake fails with this error:

CMake Error at cmake/CMakeJS.cmake:31 (string):
  string sub-command FIND: unknown last parameter
Call Stack (most recent call first):
  cmake/CMakeJS.cmake:55 (get_variable)
  CMakeLists.txt:9 (include)

The location of failure is this: https://github.com/ApsarasX/llvm-bindings/blob/69c93f7aae697c3cb3e75d01e447554b0565e3d5/cmake/CMakeJS.cmake#L31

We can overcome this issue by ensuring that NAN is not hoisted to the root level node_modules, which feels hacky and I'm not sure whether further similar issues will come up.

Do you have any suggestions to solve this better?

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

No branches or pull requests

1 participant