Project-OSRM/node-osrm

Build fails on 'npm install --build-from-source' on Ubuntu 16.04

paco-valdez opened this issue · 2 comments

I've just updated everything via apt upgrade, and just cloned current master repositories of both packages. In osrm-backend make -C test/data runs ok.

Here's the output of npm install --build-from-source:


> osrm@5.3.0-rc.4 install /home/ubuntu/node-osrm
> node-pre-gyp install --fallback-to-build

make: Entering directory '/home/ubuntu/node-osrm/build'
  CXX(target) Release/obj.target/osrm/src/node_osrm.o
In file included from ../src/node_osrm.cpp:17:0:
../src/node_osrm_support.hpp: In instantiation of ‘bool node_osrm::parseCommonParameters(const v8::Local<v8::Object>&, ParamType&) [with ParamType = std::unique_ptr<osrm::engine::api::RouteParameters>]’:
../src/node_osrm_support.hpp:529:64:   required from here
../src/node_osrm_support.hpp:425:33: error: ‘struct osrm::engine::api::RouteParameters’ has no member named ‘annotations’
             params->annotations = annotations->BooleanValue();
                                 ^
../src/node_osrm_support.hpp: In instantiation of ‘bool node_osrm::parseCommonParameters(const v8::Local<v8::Object>&, ParamType&) [with ParamType = std::unique_ptr<osrm::engine::api::TripParameters>]’:
../src/node_osrm_support.hpp:726:64:   required from here
../src/node_osrm_support.hpp:425:33: error: ‘struct osrm::engine::api::TripParameters’ has no member named ‘annotations’
../src/node_osrm_support.hpp: In instantiation of ‘bool node_osrm::parseCommonParameters(const v8::Local<v8::Object>&, ParamType&) [with ParamType = std::unique_ptr<osrm::engine::api::MatchParameters>]’:
../src/node_osrm_support.hpp:777:64:   required from here
../src/node_osrm_support.hpp:425:33: error: ‘struct osrm::engine::api::MatchParameters’ has no member named ‘annotations’
osrm.target.mk:97: recipe for target 'Release/obj.target/osrm/src/node_osrm.o' failed
make: *** [Release/obj.target/osrm/src/node_osrm.o] Error 1
make: Leaving directory '/home/ubuntu/node-osrm/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-28-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/share/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/ubuntu/node-osrm/lib/binding/osrm.node" "--module_name=osrm" "--module_path=/home/ubuntu/node-osrm/lib/binding"
gyp ERR! cwd /home/ubuntu/node-osrm
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/share/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ubuntu/node-osrm/lib/binding/osrm.node --module_name=osrm --module_path=/home/ubuntu/node-osrm/lib/binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/ubuntu/node-osrm/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:821:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.4.0-28-generic
node-pre-gyp ERR! command "/usr/bin/nodejs" "/home/ubuntu/node-osrm/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ubuntu/node-osrm
node-pre-gyp ERR! node -v v4.2.6
node-pre-gyp ERR! node-pre-gyp -v v0.6.29
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/nodejs /usr/share/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ubuntu/node-osrm/lib/binding/osrm.node --module_name=osrm --module_path=/home/ubuntu/node-osrm/lib/binding' (1)

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.13
npm ERR! Linux 4.4.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--unsafe-perm" "--build-from-source"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! osrm@5.3.0-rc.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the osrm@5.3.0-rc.4 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the osrm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs osrm
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls osrm
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/node-osrm/npm-debug.log

npm-debug.log.txt

Check if you don't have an old osrm installation lurking somewhere. The struct definition in the header seems outdated. Both master branches are definitely compatible right now (Travis CI builds them regularly).

Yes, tried adding a fresh install to PATH and compiled successfully, Thanks.