Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: npm install fails with C++/nodegyp errors #1123

Open
nickytonline opened this issue Jul 22, 2024 · 3 comments
Open

Bug: npm install fails with C++/nodegyp errors #1123

nickytonline opened this issue Jul 22, 2024 · 3 comments
Labels
bug Something isn't working component: framework related to the project framework, not the website effort: intermediate help wanted Extra attention is needed impact: large Very important issues, high priority size: M 4-8 hours of work expected
Milestone

Comments

@nickytonline
Copy link

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the quickstart.
  2. Run npx -p @idrinth-api-bench/cli iabmp
  3. Run cd benchmark
  4. Run npm install
  5. See the error like below in the logs.

Expected behavior

npm install should be able to install the dependencies.

Screenshots

No screenshot, but here is the log from npm install.

❯ npm install
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm WARN deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm ERR! code 1
npm ERR! path /Users/nicktaylor/dev/streams/stream-with-idrinth/benchmark/node_modules/msnodesqlv8
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! ACTION binding_gyp_sqlserverv8_target_print_variables src/BeginTranOperation.cpp
npm ERR! cflags_cpp gnu++17 | arch: arm64 | link_path: -L/opt/homebrew/lib -L/usr/lib -L. | msodbc_include_folders  | fileset src/BeginTranOperation.cpp src/BinaryColumn.cpp src/BoundDatum.cpp src/BoundDatumSet.cpp src/CancelOperation.cpp src/CloseOperation.cpp src/CollectOperation.cpp src/Column.cpp src/Connection.cpp src/ConnectionHandles.cpp src/EndTranOperation.cpp src/FreeStatementOperation.cpp src/MutateJS.cpp src/OdbcConnection.cpp src/OdbcConnectionBridge.cpp src/OdbcError.cpp src/OdbcHandle.cpp src/OdbcOperation.cpp src/OdbcStatement.cpp src/OdbcStatementCache.cpp src/OpenOperation.cpp src/Operation.cpp src/OperationManager.cpp src/PollingModeOperation.cpp src/PrepareOperation.cpp src/ProcedureOperation.cpp src/QueryOperation.cpp src/QueryOperationParams.cpp src/QueryPreparedOperation.cpp src/ReadColumnOperation.cpp src/ReadNextResultOperation.cpp src/ResultSet.cpp src/TimestampColumn.cpp src/UnbindOperation.cpp src/Utility.cpp src/addon.cpp src/bcp.cpp src/stdafx.cpp
npm ERR!   CXX(target) Release/obj.target/sqlserverv8/src/BeginTranOperation.o
npm ERR! prebuild-install warn install No prebuilt binaries found (target=22.0.0 runtime=node arch=arm64 libc= platform=darwin)
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@22.0.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.5 found at "/Users/nicktaylor/.pyenv/versions/3.11.5/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v22.0.0/node-v22.0.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v22.0.0/node-v22.0.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v22.0.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v22.0.0/SHASUMS256.txt
npm ERR! gyp info spawn /Users/nicktaylor/.pyenv/versions/3.11.5/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/nicktaylor/.nvm/versions/node/v22.0.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 '/Users/nicktaylor/dev/streams/stream-with-idrinth/benchmark/node_modules/msnodesqlv8/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/nicktaylor/.nvm/versions/node/v22.0.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/nicktaylor/Library/Caches/node-gyp/22.0.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=/Users/nicktaylor/Library/Caches/node-gyp/22.0.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/nicktaylor/.nvm/versions/node/v22.0.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/nicktaylor/Library/Caches/node-gyp/22.0.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/nicktaylor/dev/streams/stream-with-idrinth/benchmark/node_modules/msnodesqlv8',
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 spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/BeginTranOperation.cpp:1:
npm ERR! In file included from ../src/OdbcConnection.h:22:
npm ERR! ../src/stdafx.h:41:14: fatal error: 'msodbcsql.h' file not found
npm ERR!     #include <msodbcsql.h>
npm ERR!              ^~~~~~~~~~~~~
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/sqlserverv8/src/BeginTranOperation.o] 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.<anonymous> (/Users/nicktaylor/.nvm/versions/node/v22.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Darwin 23.5.0
npm ERR! gyp ERR! command "/Users/nicktaylor/.nvm/versions/node/v22.0.0/bin/node" "/Users/nicktaylor/.nvm/versions/node/v22.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/nicktaylor/dev/streams/stream-with-idrinth/benchmark/node_modules/msnodesqlv8
npm ERR! gyp ERR! node -v v22.0.0
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: /Users/nicktaylor/.npm/_logs/2024-07-22T16_45_10_131Z-debug-0.log

System

please complete the following information:

  • OS: macOS Sonoma 14.5
  • Version Node 20 or Node 22

Additional context

Here's where it happened on the live stream with @Idrinth, https://www.youtube.com/watch?v=W9XuBZsh78A

@nickytonline nickytonline added the bug Something isn't working label Jul 22, 2024
Copy link

Welcome in and thank you for your contribution.
Usually issues are responded to within 48 hours, but depending on the current workload that may be slightly longer.

You can also find us on slack at idrinth-api-bench.

@Idrinth Idrinth added help wanted Extra attention is needed component: framework related to the project framework, not the website effort: intermediate size: M 4-8 hours of work expected impact: large Very important issues, high priority labels Jul 22, 2024
@Idrinth
Copy link
Member

Idrinth commented Jul 22, 2024

We need someone with a Mac to dig in, can't replicate it on windows or linux.

@Idrinth Idrinth added this to the Up for grabs milestone Jul 22, 2024
@nickytonline
Copy link
Author

A bit of AI assistance is suggesting the following:

Make sure you have the necessary build tools installed:

Xcode Command Line Tools ✅
Python (node-gyp requires Python 2.7, 3.5, 3.6, 3.7, or 3.8) ❌ I have the following version

✦ ❯ python --version
Python 3.11.5

❌ Switching to one of the supported versions didn't work though.

Update npm and node-gyp:

npm install -g npm
npm install -g node-gyp

❌ Same for updating npm and node-gyp

Clear npm cache:

npm cache clean --force

❌ Same for cleaning the npm cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: framework related to the project framework, not the website effort: intermediate help wanted Extra attention is needed impact: large Very important issues, high priority size: M 4-8 hours of work expected
Projects
Status: Backlog
Development

No branches or pull requests

2 participants