JCMais / node-libcurl

libcurl bindings for Node.js
https://npmjs.org/package/node-libcurl
MIT License
660 stars 117 forks source link

Can not install node-libcurl on node 16.14.0 #337

Closed farshadfahimi closed 7 months ago

farshadfahimi commented 2 years ago

Describe the bug I'm trying to install node-libcurl on my existing api that create with adonisjs framework when delete node_modules and package-lock.json file and try to execute the npm i command the installation process blocked when try to install node-libcurl

npm timing build:link:node_modules/jsesc Completed in 27ms
npm timing build:link:node_modules/knex Completed in 27ms
npm timing build:link:node_modules/json5 Completed in 27ms
npm timing build:link:node_modules/marked Completed in 28ms
npm timing build:link:node_modules/mkdirp Completed in 28ms
npm timing build:link:node_modules/mustache Completed in 29ms
npm timing build:link:node_modules/mime Completed in 29ms
npm timing build:link:node_modules/node-gyp Completed in 29ms
npm timing build:link:node_modules/nopt Completed in 29ms
npm timing build:link:node_modules/nyc Completed in 29ms
npm timing build:link:node_modules/prettier Completed in 29ms
npm timing build:link:node_modules/npm Completed in 30ms
npm timing build:link:node_modules/pino-pretty Completed in 29ms
npm timing build:link:node_modules/pino Completed in 29ms
npm timing build:link:node_modules/rc Completed in 29ms
npm timing build:link:node_modules/resolve Completed in 29ms
npm timing build:link:node_modules/semver Completed in 29ms
npm timing build:link:node_modules/rimraf Completed in 29ms
npm timing build:link:node_modules/sshpk Completed in 29ms
npm timing build:link:node_modules/typescript Completed in 29ms
npm timing build:link:node_modules/which Completed in 29ms
npm timing build:link:node_modules/uuid Completed in 30ms
npm timing build:link:node_modules/npm/node_modules/@npmcli/installed-package-contents Completed in 29ms
npm timing build:link:node_modules/npm/node_modules/color-support Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/mkdirp Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/node-gyp Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/opener Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/nopt Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/npm-packlist Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/qrcode-terminal Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/semver Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/rimraf Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/which Completed in 25ms
npm timing build:link:node_modules/npm/node_modules/pacote Completed in 26ms
npm timing build:link Completed in 35ms
npm info run node-libcurl@2.3.4 install node_modules/node-libcurl node-pre-gyp install --fallback-to-build
⸨##################⸩ ⠋ reify:aws-sdk: info run node-libcurl@2.3.4 install node_modules/node-libcurl node-pre-gyp install --fallback-to-build

at the last line system blocked and not go on

Version information:

ubuntu 20.04
nodejs 16.14.0
npm 8.5.0

package info:

{
  "name": "adonis-api",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "build": "node ace build --production",
    "start": "node server.js",
    "dev": "node ace serve --watch",
    "lint": "eslint . --ext=.ts",
    "format": "prettier --write .",
    "test": "node -r @adonisjs/assembler/build/register japaFile.ts",
    "coverage": "nyc npm run test"
  },
  "devDependencies": {
    "@adonisjs/assembler": "^5.4.1",
    "@types/supertest": "^2.0.11",
    "adonis-preset-ts": "^2.1.0",
    "eslint": "^8.9.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-adonis": "^2.1.0",
    "eslint-plugin-prettier": "^4.0.0",
    "execa": "^5.1.1",
    "get-port": "^5.1.1",
    "japa": "^3.1.1",
    "npm": "^8.1.1",
    "nyc": "^15.1.0",
    "pino-pretty": "^7.5.1",
    "prettier": "^2.5.1",
    "supertest": "^6.1.4",
    "typescript": "~4.5",
    "youch": "^3.1.0",
    "youch-terminal": "^2.1.2"
  },
  "dependencies": {
    "@adonisjs/ally": "^4.1.1",
    "@adonisjs/auth": "^8.0.9",
    "@adonisjs/core": "^5.4.2",
    "@adonisjs/lucid": "^16.3.2",
    "@adonisjs/mail": "^7.2.3",
    "@adonisjs/redis": "^7.1.0",
    "@adonisjs/repl": "^3.1.8",
    "@farshadfahimi/adonis-cache": "^2.2.0",
    "@types/bcryptjs": "^2.4.2",
    "@types/crypto-js": "^4.0.1",
    "@types/socket.io": "^3.0.2",
    "adonis-lucid-soft-deletes": "^1.2.0",
    "aws-sdk": "^2.968.0",
    "axios": "^0.24.0",
    "bcryptjs": "^2.4.3",
    "crypto-js": "^4.0.0",
    "lodash": "^4.17.21",
    "luxon": "^1.27.0",
    "mailersend": "^1.3.1",
    "moment-jalaali": "^0.9.4",
    "mysql": "^2.18.1",
    "node-libcurl": "^2.3.4",
    "proxy-addr": "^2.0.7",
    "reflect-metadata": "^0.1.13",
    "soap": "^0.40.0",
    "socket.io": "^4.1.2",
    "source-map-support": "^0.5.21"
  }
}
farshadfahimi commented 2 years ago

I'm trying to install package from the source and got error

farshad@farshad-MS-ACB311:/var/www/fafait/adonis-api$ npm install node-libcurl --build-from-source --curl_static_build=true
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /var/www/fafait/adonis-api/node_modules/node-libcurl
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! make: Entering directory '/var/www/fafait/adonis-api/node_modules/node-libcurl/build'
npm ERR!   CXX(target) Release/obj.target/node_libcurl/src/node_libcurl.o
npm ERR!   CXX(target) Release/obj.target/node_libcurl/src/Easy.o
npm ERR!   CXX(target) Release/obj.target/node_libcurl/src/Share.o
npm ERR!   CXX(target) Release/obj.target/node_libcurl/src/Multi.o
npm ERR!   CXX(target) Release/obj.target/node_libcurl/src/Curl.o
npm ERR!   CXX(target) Release/obj.target/node_libcurl/src/CurlHttpPost.o
npm ERR!   CXX(target) Release/obj.target/node_libcurl/src/CurlVersionInfo.o
npm ERR!   CXX(target) Release/obj.target/node_libcurl/src/Http2PushFrameHeaders.o
npm ERR!   SOLINK_MODULE(target) Release/obj.target/node_libcurl.node
npm ERR! make: Leaving directory '/var/www/fafait/adonis-api/node_modules/node-libcurl/build'
npm ERR! Failed to execute '/home/farshad/.nvm/versions/node/v16.14.0/bin/node /home/farshad/.nvm/versions/node/v16.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/var/www/fafait/adonis-api/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/var/www/fafait/adonis-api/node_modules/node-libcurl/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.5
npm ERR! node-pre-gyp info using node@16.14.0 | linux | x64
npm ERR! node-pre-gyp info build requesting source compile
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.0 | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/farshad/.nvm/versions/node/v16.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/var/www/fafait/adonis-api/node_modules/node-libcurl/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/farshad/.nvm/versions/node/v16.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/farshad/.cache/node-gyp/16.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/farshad/.cache/node-gyp/16.14.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/farshad/.nvm/versions/node/v16.14.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/farshad/.cache/node-gyp/16.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/var/www/fafait/adonis-api/node_modules/node-libcurl',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.0 | linux | x64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../../nan/nan.h:58,
npm ERR!                  from ../src/Curl.h:13,
npm ERR!                  from ../src/node_libcurl.cc:7:
npm ERR! /home/farshad/.cache/node-gyp/16.14.0/include/node/node.h:842:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm ERR!   842 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |                                           ^
npm ERR! /home/farshad/.cache/node-gyp/16.14.0/include/node/node.h:876:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR!   876 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../src/node_libcurl.cc:68:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR!    68 | NODE_MODULE(node_libcurl, Init);
npm ERR!       | ^~~~~~~~~~~
npm ERR! ../src/Easy.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE NodeLibcurl::Easy::GetInfo(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/Easy.cc:2103:58: warning: ‘v8::Local<v8::Context> v8::Object::CreationContext()’ is deprecated: Use MaybeLocal<Context> GetCreationContext() [-Wdeprecated-declarations]
npm ERR!  2103 |               auto value = arr->Set(arr->CreationContext(), arr->Length(),
npm ERR!       |                                                          ^
npm ERR! In file included from /home/farshad/.cache/node-gyp/16.14.0/include/node/node.h:63,
npm ERR!                  from ../../nan/nan.h:58,
npm ERR!                  from ../src/Curl.h:13,
npm ERR!                  from ../src/Multi.h:10,
npm ERR!                  from ../src/Easy.h:10,
npm ERR!                  from ../src/Easy.cc:7:
npm ERR! /home/farshad/.cache/node-gyp/16.14.0/include/node/v8.h:4316:18: note: declared here
npm ERR!  4316 |   Local<Context> CreationContext();
npm ERR!       |                  ^~~~~~~~~~~~~~~
npm ERR! ../src/Easy.cc:2137:56: warning: ‘v8::Local<v8::Context> v8::Object::CreationContext()’ is deprecated: Use MaybeLocal<Context> GetCreationContext() [-Wdeprecated-declarations]
npm ERR!  2137 |             auto value = arr->Set(arr->CreationContext(), arr->Length(),
npm ERR!       |                                                        ^
npm ERR! In file included from /home/farshad/.cache/node-gyp/16.14.0/include/node/node.h:63,
npm ERR!                  from ../../nan/nan.h:58,
npm ERR!                  from ../src/Curl.h:13,
npm ERR!                  from ../src/Multi.h:10,
npm ERR!                  from ../src/Easy.h:10,
npm ERR!                  from ../src/Easy.cc:7:
npm ERR! /home/farshad/.cache/node-gyp/16.14.0/include/node/v8.h:4316:18: note: declared here
npm ERR!  4316 |   Local<Context> CreationContext();
npm ERR!       |                  ^~~~~~~~~~~~~~~
npm ERR! ../src/CurlVersionInfo.cc:19:6: warning: ‘void NodeLibcurl::{anonymous}::SetObjPropertyToNullOrValue(v8::Local<v8::Object>, std::string, TValue) [with TValue = v8::Local<v8::Primitive>]’ defined but not used [-Wunused-function]
npm ERR!    19 | void SetObjPropertyToNullOrValue<v8::Local<v8::Primitive>>(v8::Local<v8::Object> obj,
npm ERR!       |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /usr/bin/ld: cannot find -lnghttp2
npm ERR! /usr/bin/ld: cannot find -lidn2
npm ERR! /usr/bin/ld: cannot find -lrtmp
npm ERR! /usr/bin/ld: cannot find -lssh
npm ERR! /usr/bin/ld: cannot find -lpsl
npm ERR! /usr/bin/ld: cannot find -llber
npm ERR! /usr/bin/ld: cannot find -lldap
npm ERR! /usr/bin/ld: cannot find -lbrotlidec
npm ERR! collect2: error: ld returned 1 exit status
npm ERR! make: *** [node_libcurl.target.mk:175: Release/obj.target/node_libcurl.node] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/farshad/.nvm/versions/node/v16.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.4.0-99-generic
npm ERR! gyp ERR! command "/home/farshad/.nvm/versions/node/v16.14.0/bin/node" "/home/farshad/.nvm/versions/node/v16.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/var/www/fafait/adonis-api/node_modules/node-libcurl/lib/binding/node_libcurl.node" "--module_name=node_libcurl" "--module_path=/var/www/fafait/adonis-api/node_modules/node-libcurl/lib/binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd /var/www/fafait/adonis-api/node_modules/node-libcurl
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/home/farshad/.nvm/versions/node/v16.14.0/bin/node /home/farshad/.nvm/versions/node/v16.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/var/www/fafait/adonis-api/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/var/www/fafait/adonis-api/node_modules/node-libcurl/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/var/www/fafait/adonis-api/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Linux 5.4.0-99-generic
npm ERR! node-pre-gyp ERR! command "/home/farshad/.nvm/versions/node/v16.14.0/bin/node" "/var/www/fafait/adonis-api/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /var/www/fafait/adonis-api/node_modules/node-libcurl
npm ERR! node-pre-gyp ERR! node -v v16.14.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.5
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/farshad/.npm/_logs/2022-02-12T13_21_02_089Z-debug-0.log
JCMais commented 7 months ago

Sorry, in an effort to keep maintaining this project, I am closing old tickets. If the issue persists with the latest version of node-libcurl, feel free to create a new ticket.