简体   繁体   中英

npm install fails while dependency build

I am running npm install for below package.json project file:

{
  "name": "tradesync",
  "version": "1.0.0",
  "description": "",
  "main": "consumer.js",
  "dependencies": {
    "async": "^2.6.1",
    "avsc": "^5.1.1",
    "cron": "^1.3.0",
    "deepstream.io-client-js": "^2.3.0",
    "firebase-admin": "^5.5.1",
    "got": "^8.3.1",
    "kafka-avro": "^0.8.0",
    "mysql": "^2.15.0",
    "node-avro-io": "^1.0.1",
    "node-cron": "^1.2.1",
    "node-rdkafka": "^2.2.2",
    "orderbook-engine": "^1.1.2",
    "requestretry": "^1.12.2",
    "schema-registry": "^1.17.0",
    "slack-node": "^0.1.8",
    "socket.io-client": "^2.0.4",
    "tedious": "^2.1.5",
    "tedious-connection-pool": "^1.0.5",
    "underscore": "^1.8.3",
    "winston": "^2.4.1"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "ordermatcher",
    "mywallet"
  ],
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": ""
  },
  "homepage": ""
}

It's breaking and showing error logs at v8 functions, here is the partial snapshot of error logs

/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3914:44: note:   candidate expects 1 argument, 2 provided
../src/Int64.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Int64::Sub(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/Int64.cc:361:53: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Local<v8::Value> [2])’
   Local<Object> instance = cons->NewInstance(2, argv);
                                                     ^
In file included from /home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/node.h:63:0,
                 from ../src/Int64.cc:5:
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3911:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3911:44: note:   candidate expects 3 arguments, 2 provided
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3914:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3914:44: note:   candidate expects 1 argument, 2 provided
Int64.target.mk:102: recipe for target 'Release/obj.target/Int64/src/Int64.o' failed
make: *** [Release/obj.target/Int64/src/Int64.o] Error 1
make: Leaving directory '/home/local/mywallet/suresh.prajapati/projects/tradesync/node_modules/int64-native/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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.13.0-45-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /home/local/mywallet/suresh.prajapati/projects/tradesync/node_modules/int64-native
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! int64-native@0.4.0 install: `node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the int64-native@0.4.0 install script.

Here is sys version info

node - v10.6.0 npm - 6.1.0 Python - 2.7.12

Searched on the internet but none of them actually helped. Ready to try out anything which can solve above build fail problem.

Tons of thanks in advance.

This can be a Node issue. Try to install latest LTS version https://nodejs.org/en/download/ .

Should fix it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM