Running the example fails

Open
#1 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cmake, cpp, javascript, node.js

Research direction

Run ./run.sh in test/simple and inspect the failure from test/simple/simple.js. Read CMakeLists.txt at the add_node_module call and node_modules/@mapbox/cmake-node-module/module.cmake around line 64, then compare the built .node file with the path being required. Done means the example runs successfully without the module-not-found error.

Written by the indexing model from the issue text.

Description

I've got the following trace :

$ ./run.sh
> simple@1.0.0 install /tmp/cmake-node-module/test/simple
> cmake-node-module

-- The CXX compiler identification is GNU 8.2.1
-- The C compiler identification is GNU 8.2.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning at node_modules/@mapbox/cmake-node-module/module.cmake:64 (message):
  [Node.js] Unused arguments: 'INSTALL_DIR;lib'
Call Stack (most recent call first):
  CMakeLists.txt:8 (add_node_module)


-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/cmake-node-module/test/simple/build
Scanning dependencies of target simple.abi-64
[ 50%] Building CXX object CMakeFiles/simple.abi-64.dir/simple.cpp.o
[100%] Linking CXX shared library simple.abi-64.node
[100%] Built target simple.abi-64
npm WARN simple@1.0.0 No description
npm WARN simple@1.0.0 No repository field.
npm WARN simple@1.0.0 No license field.

audited 1 package in 2.257s
found 0 vulnerabilities

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module './simple.abi-64'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/tmp/cmake-node-module/test/simple/simple.js:1:80)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
[1]    4465 exit 1     ./run.sh
Dominant language
CMake
Stars
20
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/cmake-node-module

All issues in mapbox/cmake-node-module

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.