简体   繁体   English

依赖项构建时,npm安装失败

[英]npm install fails while dependency build

I am running npm install for below package.json project file: 我正在下面的package.json项目文件运行npm install

{
  "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 它正在破坏并显示v8函数的错误日志,这是错误日志的部分快照

/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 节点-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/ . 尝试安装最新的LTS版本https://nodejs.org/en/download/

Should fix it. 应该修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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