segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
367 stars 191 forks source link

@segment/tsub relies on outdated dependencies which fail the build #953

Closed Domeee closed 4 months ago

Domeee commented 5 months ago

Installation of "@segment/analytics-react-native": "2.x" fails.

npm error code 1
npm error path something/node_modules/@stdlib/number-float64-base-normalize
npm error command failed
npm error command sh -c node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.1.0
npm error gyp info using node@22.2.0 | linux | x64
npm error gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/home/dome/.asdf/installs/nodejs/22.2.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/home/dome/code/enerjoy/maintenance/code/enerjoy-mobile/node_modules/@stdlib/number-float64-base-normalize/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/home/dome/.asdf/installs/nodejs/22.2.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/home/dome/.cache/node-gyp/22.2.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/home/dome/.cache/node-gyp/22.2.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/home/dome/.asdf/installs/nodejs/22.2.0/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/home/dome/.cache/node-gyp/22.2.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/home/dome/code/enerjoy/maintenance/code/enerjoy-mobile/node_modules/@stdlib/number-float64-base-normalize',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp: binding.gyp not found (cwd: /home/dome/code/enerjoy/maintenance/code/enerjoy-mobile/node_modules/@stdlib/number-float64-base-normalize) while trying to load binding.gyp
npm error gyp ERR! configure error 
npm error gyp ERR! stack Error: `gyp` failed with exit code: 1
npm error gyp ERR! stack at ChildProcess.<anonymous> (/home/dome/.asdf/installs/nodejs/22.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:297:18)
npm error gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Linux 6.9.3-arch1-1
npm error gyp ERR! command "/home/dome/.asdf/installs/nodejs/22.2.0/bin/node" "/home/dome/.asdf/installs/nodejs/22.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /home/dome/code/enerjoy/maintenance/code/enerjoy-mobile/node_modules/@stdlib/number-float64-base-normalize
npm error gyp ERR! node -v v22.2.0
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok

Steps to reproduce npm i

Expected behavior npm packages installation succeedes

Actual behavior npm installation does not succeed

Resolution @segment/analytics-react-native depends on @segment/tsub which depends on a outdated version of "@stdlib/math-base-special-ldexp".

  "overrides": {
    "@segment/analytics-react-native": {
      "@segment/tsub": {
        "@stdlib/math-base-special-ldexp": "^0.2.2"
      }
    }
  }

This resolves my build issues. Please update your dependencies accordingly.

VladosDosvidos commented 5 months ago

Any updates?

hvardhan-unth commented 4 months ago

This dependency issue has already been raised in the tsub repository: https://github.com/segmentio/tsub-js/issues/45 It will be tracked in the above mentioned issue.