Error when running npm install

Hi,

I’m experiencing some troubles when installing LPWAN server on Debian 10.

This is the stack trace :

  AR(target) Release/obj.target/libares.a
  COPY Release/libares.a
  CC(target) Release/obj.target/address_sorting/deps/grpc/third_party/address_sorting/address_sorting.o
  CC(target) Release/obj.target/address_sorting/deps/grpc/third_party/address_sorting/address_sorting_posix.o
  CC(target) Release/obj.target/address_sorting/deps/grpc/third_party/address_sorting/address_sorting_windows.o
  AR(target) Release/obj.target/libaddress_sorting.a
  COPY Release/libaddress_sorting.a
  CXX(target) Release/obj.target/grpc_node/ext/byte_buffer.o
  CXX(target) Release/obj.target/grpc_node/ext/call.o
../ext/call.cc: In function ‘bool grpc::node::CreateMetadataArray(v8::Local<v8::Object>, grpc_metadata_array*)’:
../ext/call.cc:104:58: error: no matching function for call to ‘v8::Array::Get(unsigned int&)’
     Local<String> current_key(Nan::To<String>(keys->Get(i)).ToLocalChecked());
                                                          ^
In file included from /home/iot/.cache/node-gyp/13.3.0/include/node/node.h:63,
                 from ../ext/call.cc:23:
/home/iot/.cache/node-gyp/13.3.0/include/node/v8.h:3594:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/iot/.cache/node-gyp/13.3.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/iot/.cache/node-gyp/13.3.0/include/node/v8.h:3597:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/iot/.cache/node-gyp/13.3.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
../ext/call.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE grpc::node::Call::StartBatch(Nan::NAN_METHOD_ARGS_TYPE)’:
../ext/call.cc:681:35: error: no matching function for call to ‘v8::Object::Get(uint32_t&)’
     if (!op->ParseOp(obj->Get(type), &ops[i])) {
                                   ^
In file included from /home/iot/.cache/node-gyp/13.3.0/include/node/node.h:63,
                 from ../ext/call.cc:23:
/home/iot/.cache/node-gyp/13.3.0/include/node/v8.h:3594:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/iot/.cache/node-gyp/13.3.0/include/node/v8.h:3594:43: note:   candidate expects 2 arguments, 1 provided
/home/iot/.cache/node-gyp/13.3.0/include/node/v8.h:3597:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                           ^~~
/home/iot/.cache/node-gyp/13.3.0/include/node/v8.h:3597:43: note:   candidate expects 2 arguments, 1 provided
make: *** [grpc_node.target.mk:194: Release/obj.target/grpc_node/ext/call.o] Error 1
make : on quitte le répertoire « /home/iot/lpwanserver/node_modules/grpc/build »
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:219:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
gyp ERR! System Linux 4.19.0-6-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/iot/lpwanserver/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/iot/lpwanserver/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v79"
gyp ERR! cwd /home/iot/lpwanserver/node_modules/grpc
gyp ERR! node -v v13.3.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/iot/lpwanserver/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/iot/lpwanserver/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/iot/lpwanserver/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:219:5)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1027:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:5)
node-pre-gyp ERR! System Linux 4.19.0-6-amd64
node-pre-gyp ERR! command "/usr/bin/node" "/home/iot/lpwanserver/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/iot/lpwanserver/node_modules/grpc
node-pre-gyp ERR! node -v v13.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/iot/lpwanserver/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/iot/lpwanserver/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.22.2 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.22.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/iot/.npm/_logs/2020-01-13T16_55_53_945Z-debug.log

This is the ouput from node -v and npm -v:
v13.3.0
6.13.1

If you have any solutions :smiley:

Thanks
Regards

Solved with this thread : https://doc.ubuntu-fr.org/nodejs

Some symlink was missing :smiley: Resolved with:

sudo ln -s /usr/bin/nodejs /usr/local/bin/node
sudo ln -s /usr/bin/npm /usr/local/bin/npm

Glad it’s solved. Thanks for posting the solution for others.