代码之家  ›  专栏  ›  技术社区  ›  Suresh Prajapati

依赖项生成时NPM安装失败

  •  0
  • Suresh Prajapati  · 技术社区  · 6 年前

    我在跑步 npm install 对于以下package.json项目文件:

    {
      "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": ""
    }
    

    它在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.
    

    这是系统版本信息

    节点-v10.6.0 净现值-6.1.0 巨蟒-2.7.12

    在互联网上搜索,但实际上没有任何帮助。准备好尝试任何可以解决上述构建失败问题的方法。

    提前表示衷心的感谢。

    1 回复  |  直到 6 年前
        1
  •  1
  •   Karen Grigoryan    6 年前

    这可能是一个节点问题。尝试安装最新的LTS版本 https://nodejs.org/en/download/ .

    应该修复它。