segmentio / analytics-next

Segment Analytics.js 2.0
https://segment.com/docs/connections/sources/catalog/libraries/website/javascript
MIT License
402 stars 136 forks source link

npm install fails for Node 18.XX and Node 20.XX #1082

Closed pratik149 closed 5 months ago

pratik149 commented 5 months ago

Unable to install the package using Node 18.XX and Node 20.XX but when I tried with Node 16.XX it worked, but I can't downgrade Node in my project because other dependencies requires Node 18+.

OS: Windows 11 Home 10.0.22631 Build 22631 Node: Node 20.12.2 NPM: 10.5.0

Following is the error which I get after running npm install @segment/analytics-next

$ npm install @segment/analytics-next
npm ERR! code 1
npm ERR! path C:\wamp64\www\projects\pixel-plus\ribeme\ribeme-web\node_modules\@stdlib\number-float64-base-normalize
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.1.0
npm ERR! gyp info using node@20.12.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.3 found at "C:\Users\prati\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.32002.261) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\prati\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\wamp64\\www\\projects\\pixel-plus\\ribeme\\ribeme-web\\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 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\wamp64\\www\\projects\\pixel-plus\\ribeme\\ribeme-web\\node_modules\\@stdlib\\number-float64-base-normalize\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\wamp64\\www\\projects\\pixel-plus\\ribeme\\ribeme-web\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\prati\\AppData\\Local\\node-gyp\\Cache\\20.12.2\\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=C:\\Users\\prati\\AppData\\Local\\node-gyp\\Cache\\20.12.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\wamp64\\www\\projects\\pixel-plus\\ribeme\\ribeme-web\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\prati\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.12.2\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\wamp64\\www\\projects\\pixel-plus\\ribeme\\ribeme-web\\node_modules\\@stdlib\\number-float64-base-normalize',
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 'C:\\wamp64\\www\\projects\\pixel-plus\\ribeme\\ribeme-web\\node_modules\\@stdlib\\number-float64-base-normalize\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: binding.gyp not found (cwd: C:\wamp64\www\projects\pixel-plus\ribeme\ribeme-web\node_modules\@stdlib\number-float64-base-normalize) while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (C:\wamp64\www\projects\pixel-plus\ribeme\ribeme-web\node_modules\node-gyp\lib\configure.js:297:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:518:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22631
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\wamp64\\www\\projects\\pixel-plus\\ribeme\\ribeme-web\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\wamp64\www\projects\pixel-plus\ribeme\ribeme-web\node_modules\@stdlib\number-float64-base-normalize
npm ERR! gyp ERR! node -v v20.12.2
npm ERR! gyp ERR! node-gyp -v v10.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:\Users\prati\AppData\Local\npm-cache\_logs\2024-05-02T06_11_20_669Z-debug-0.log
silesky commented 5 months ago

Thanks for reporting! This is a duplicate of https://github.com/segmentio/analytics-next/issues/1044