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

node_modules directory empty at install time #14

Open
ramirezd42 opened this issue Feb 8, 2017 · 0 comments
Open

node_modules directory empty at install time #14

ramirezd42 opened this issue Feb 8, 2017 · 0 comments

Comments

@ramirezd42
Copy link

I have a module i'm developing that depends on boost and I'm to get this working.

It works fine when i run npm install from the root of the directory itself. But when i actually push the module to github and npm install this module from another project the install script fails because it can't find the boost-lib directory anywhere. These seems to be because the node_modules directory is not available at the time npm runs the install script.

Here is the relevant bit of my CMakeLists.txt:

...
message("Searching In: ${CMAKE_CURRENT_SOURCE_DIR}")
file(GLOB_RECURSE boostlib_cmake_path "${CMAKE_CURRENT_SOURCE_DIR}/node_modules" "BoostLib.cmake")
list(GET boostlib_cmake_path 0 boostlib_cmake_path)
get_filename_component(boostlib_cmake_path "${boostlib_cmake_path}" DIRECTORY)
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${boostlib_cmake_path}")
include(BoostLib)
require_boost_libs(">= 1.6.0" system)
...

The package.json of the module itself has the following:

{
// ...
  "scripts": {
    "install": "ls node_modules && cmake-js compile"
  },
  "dependencies": {
    "boost-lib": "^0.11.3",
    "cmake-js": "^3.4.0",
    "nan": "^2.5.1"
  },
}

The error CMake gives when i try to npm install the module from another project:

CMake Error at CMakeLists.txt:22 (list):
  list GET given empty list


CMake Error at CMakeLists.txt:25 (include):
  include could not find load file:

    BoostLib


CMake Error at CMakeLists.txt:26 (require_boost_libs):
  Unknown CMake command "require_boost_libs".

The result of running ls node_modules at the time the module's npm install script gets called:

ls: node_modules: No such file or directory

Not sure where i should be looking for boost-lib if there's no node_modules directory yet. Thoughts?

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