indix / kafkajs-lz4

🗜 LZ4 compression codec for KafkaJS
MIT License
15 stars 8 forks source link

yarn add kafkajs-lz4 issue #5

Closed Mickael-M closed 3 years ago

Mickael-M commented 3 years ago

Hello everyone,

I end up with this issue when trying install kafkajs-lz4:

Debugger listening on ws://127.0.0.1:35199/f902c608-883d-4c84-963a-d05c60fb4e8c
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
yarn add v1.22.5
warning ../../package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /home/mickael/certificate/kafkaConnection/node_modules/lz4: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /home/mickael/certificate/kafkaConnection/node_modules/lz4
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@12.18.4 | linux | x64
gyp info find Python using Python version 2.7.18 found at "/usr/bin/python2"
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args   '/home/mickael/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/mickael/certificate/kafkaConnection/node_modules/lz4/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/mickael/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/mickael/.cache/node-gyp/12.18.4/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/mickael/.cache/node-gyp/12.18.4',
gyp info spawn args   '-Dnode_gyp_dir=/home/mickael/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/mickael/.cache/node-gyp/12.18.4/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/mickael/certificate/kafkaConnection/node_modules/lz4',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Debugger listening on ws://127.0.0.1:42773/b91d4216-5886-4dc8-a6be-86c4cb20d334
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/mickael/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.0-48-generic
gyp ERR! command "/home/mickael/.nvm/versions/node/v12.18.4/bin/node" "/home/mickael/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mickael/certificate/kafkaConnection/node_modules/lz4
gyp ERR! node -v v12.18.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

Did anyone face this issue? Is there a way to work around it? Thanks in advance for your answers

paambaati commented 3 years ago

The trace shows debugger running. It isn’t supposed to do that when you run the yarn command.

Can you share your package.json and ensure you’re running yarn install from the same directory as package.json?

Mickael-M commented 3 years ago

Hi @paambaati

Thanks a lot for you quick answer.

here's my package.json:

{
  "name": "kafkaConnection",
  "version": "0.0.0",
  "license": "ISC",
  "scripts": {
    "build": "node build.js && tsc --build tsconfig.prod.json",
    "lint": "eslint --fix './src/**/*.ts'",
    "start": "node -r module-alias/register ./dist --env=production",
    "start:dev": "nodemon",
    "test": "nodemon --config ./spec/nodemon.json",
    "prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write"
  },
  "nodemonConfig": {
    "watch": [
      "src"
    ],
    "ext": "ts, html",
    "ignore": [
      "src/public"
    ],
    "exec": "ts-node -r tsconfig-paths/register ./src"
  },
  "_moduleAliases": {
    "@daos": "dist/daos",
    "@entities": "dist/entities",
    "@shared": "dist/shared",
    "@server": "dist/Server",
    "@kafka": "dist/kafka",
    "@service": "dist/service",
    "@model": "dist/model"
  },
  "dependencies": {
    "@types/ip": "^1.1.0",
    "command-line-args": "^5.1.1",
    "cookie-parser": "^1.4.5",
    "dotenv": "^8.2.0",
    "express": "^4.17.1",
    "express-async-errors": "^3.1.1",
    "jsonfile": "^6.0.1",
    "kafkajs": "^1.13.0",
    "module-alias": "^2.2.2",
    "node-gyp": "^7.1.0",
    "tslib": "^2.0.1",
    "winston": "^3.3.3"
  },
  "devDependencies": {
    "@types/command-line-args": "^5.0.0",
    "@types/cookie-parser": "^1.4.2",
    "@types/eslint-plugin-prettier": "^3.1.0",
    "@types/express": "^4.17.8",
    "@types/find": "^0.2.1",
    "@types/helmet": "0.0.48",
    "@types/jasmine": "^3.5.14",
    "@types/jsonfile": "^6.0.0",
    "@types/morgan": "^1.9.1",
    "@types/node": "^14.10.3",
    "@types/supertest": "^2.0.10",
    "@typescript-eslint/eslint-plugin": "^4.1.1",
    "@typescript-eslint/parser": "^4.1.1",
    "eslint": "^7.9.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-prettier": "^3.1.4",
    "find": "^0.3.0",
    "fs-extra": "^9.0.1",
    "jasmine": "^3.6.1",
    "nodemon": "^2.0.4",
    "prettier": "^2.1.2",
    "supertest": "^4.0.2",
    "ts-node": "^9.0.0",
    "tsconfig-paths": "^3.9.0",
    "typescript": "^4.0.2"
  }
}

I have the same issue with node-lz4, but only for those 2, I must do something wrong but I can't figure out what exactly, and can't find a lot of info about similar issues.

thanks in advance for your response.