mohebifar / mohebifar/openbabel-node

npm install fails due to node-gyp rebuild step depending on packages built for old versions of Node

Open
#8 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
27
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Hi there! I'm extremely interested in using this package (it's the lightest-weight and best looking package out there) but can't install it on a current-ish version of node (e.g. node v15).

npm install openbabel fails due to node-gyp rebuild failing, due to what looks like an outdated version of the nan package built for older versions of node? Not 100% sure as I don't work with C++ builds/compiling to a node package. But I'm guessing you'll have greater insight.

> openbabel@1.2.3 install /Users/xxx/xxx-app/node_modules/openbabel
> node-gyp rebuild

  CXX(target) Release/obj.target/openbabel/src/atom.o
In file included from ../src/atom.cpp:2:
In file included from ../src/mol.h:11:
In file included from ../node_modules/nan/nan.h:111:
../node_modules/nan/nan_new.h:24:43: error: no member named 'Handle' in namespace 'v8'
template <typename T> v8::Local<T> To(v8::Handle<v8::Integer> i);
                                      ~~~~^
../node_modules/nan/nan_new.h:24:61: error: expected '(' for function-style cast or type construction
template <typename T> v8::Local<T> To(v8::Handle<v8::Integer> i);
                                                 ~~~~~~~~~~~^
../node_modules/nan/nan_new.h:24:63: error: use of undeclared identifier 'i'
template <typename T> v8::Local<T> To(v8::Handle<v8::Integer> i);

. . .
. . .
etc.
etc.

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/openbabel/src/atom.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/xxx/.nvm/versions/node/v15.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:378:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/Users/xxx/.nvm/versions/node/v15.9.0/bin/node" "/Users/adam/.nvm/versions/node/v15.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/xxx/xxx-app/node_modules/openbabel
gyp ERR! node -v v15.9.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Reproduce the npm install openbabel failure with Node v15 and inspect the native build path beginning at src/atom.cpp and src/mol.h, along with the reported node_modules/nan/nan.h errors. Done means the package installs and node-gyp rebuild completes successfully on a current Node version.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, node.js
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.