node-gyp: node-gyp rebuild error

Hello When i tried to install and rebuild some dependencies, I have and error, I have already tried to reinstall python and nodejs but do nothings

  • Node Version: npm 8.3.0 node 16.13.2
  • Platform: Windows 11 22000.438
  • Compiler: msvc
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\clement\\Documents\\dev\\project\\Tess\\node_modules\\glasstron',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\clement\Documents\dev\project\Tess\node_modules\glasstron'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\clement\\Documents\\dev\\project\\Tess\\node_modules\\glasstron'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\clement\Documents\dev\project\Tess\node_modules\node-pty
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/install.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@16.13.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.2/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.2/win-x86/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.2/win-x64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.2/win-arm64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.2/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.2/win-x64/node.lib
npm ERR! gyp http 404 https://nodejs.org/download/release/v16.13.2/win-arm64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.2/win-x86/node.lib
npm ERR! gyp info find VS using VS2019 (16.11.32106.194) 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:\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\clement\\Documents\\dev\\project\\Tess\\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:\\Users\\clement\\Documents\\dev\\project\\Tess\\node_modules\\node-pty\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\clement\\Documents\\dev\\project\\Tess\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\clement\\AppData\\Local\\node-gyp\\Cache\\16.13.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\\clement\\AppData\\Local\\node-gyp\\Cache\\16.13.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\clement\\Documents\\dev\\project\\Tess\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\clement\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.13.2\\\\<(target_arch)\\\\node.lib',        
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\clement\\Documents\\dev\\project\\Tess\\node_modules\\node-pty',
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:\\Users\\clement\\Documents\\dev\\project\\Tess\\node_modules\\node-pty\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\gyp_main.py", line 45, in <module>
npm ERR!     sys.exit(gyp.script_main())
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 662, in script_main
npm ERR!     return main(sys.argv[1:])
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 654, in main
npm ERR!     return gyp_main(args)
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 621, in gyp_main
npm ERR!     [generator, flat_list, targets, data] = Load(
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 142, in Load
npm ERR!     result = gyp.input.Load(
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 3009, in Load
npm ERR!     LoadTargetBuildFile(
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 481, in LoadTargetBuildFile
npm ERR!     LoadTargetBuildFile(
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 427, in LoadTargetBuildFile
npm ERR!     ProcessVariablesAndConditionsInDict(
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1327, in ProcessVariablesAndConditionsInDict     
npm ERR!     ProcessVariablesAndConditionsInDict(
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1336, in ProcessVariablesAndConditionsInDict     
npm ERR!     expanded = ExpandVariables(value, phase, variables, build_file)
npm ERR!   File "C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 980, in ExpandVariables
npm ERR!     p_stderr = p_stderr.decode("utf-8")
npm ERR! UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 81: invalid start byte
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.onCpExit (C:\Users\clement\Documents\dev\project\Tess\node_modules\node-gyp\lib\configure.js:353:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\clement\\Documents\\dev\\project\\Tess\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\clement\Documents\dev\project\Tess\node_modules\node-pty
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v8.2.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\clement\AppData\Local\npm-cache\_logs\2022-01-19T17_02_23_990Z-debug-0.log

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I have got the latest node-gyp 8.4.1 and Python 3.10. Yet I’m still having the issue.

$ npm install ffi
npm ERR! code 1
npm ERR! path /Users/owen/code/src/github.com/meroxa/node-funtime/node_modules/ref
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! CXX(target) Release/obj.target/binding/src/binding.o
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.13.2 | darwin | x64
npm ERR! gyp info find Python using Python version 3.10.1 found at "/usr/local/opt/python@3.10/bin/python3.10"
npm ERR! gyp info spawn /usr/local/opt/python@3.10/bin/python3.10
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/owen/.nodenv/versions/16.13.2/lib/node_modules/npm/node_modules/@npmcli/run-script/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/owen/code/src/github.com/meroxa/node-funtime/node_modules/ref/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/owen/.nodenv/versions/16.13.2/lib/node_modules/npm/node_modules/@npmcli/run-script/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/owen/Library/Caches/node-gyp/16.13.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=/Users/owen/Library/Caches/node-gyp/16.13.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/owen/.nodenv/versions/16.13.2/lib/node_modules/npm/node_modules/@npmcli/run-script/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/owen/Library/Caches/node-gyp/16.13.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/owen/code/src/github.com/meroxa/node-funtime/node_modules/ref',
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! ../src/binding.cc:222:43: error: too few arguments to function call, single argument 'isolate' was not specified
npm ERR!   bool persistent = info[3]->BooleanValue();
npm ERR!                     ~~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3096:8: note: 'BooleanValue' declared here
npm ERR!   bool BooleanValue(Isolate* isolate) const;
npm ERR!        ^
npm ERR! ../src/binding.cc:253:38: error: too few arguments to function call, single argument 'context' was not specified
npm ERR!   size_t size = info[2]->Uint32Value();
npm ERR!                 ~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3104:41: note: 'Uint32Value' declared here
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
npm ERR!                                         ^
npm ERR! ../src/binding.cc:253:10: error: no viable conversion from 'Maybe<uint32_t>' (aka 'Maybe<unsigned int>') to 'size_t' (aka 'unsigned long')
npm ERR!   size_t size = info[2]->Uint32Value();
npm ERR!          ^      ~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:360:23: error: no matching constructor for initialization of 'String::Utf8Value'
npm ERR!     String::Utf8Value _str(in);
npm ERR!                       ^    ~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3588:5: note: candidate constructor not viable: no known conversion from 'Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
npm ERR!     Utf8Value(const Utf8Value&) = delete;
npm ERR!     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3581:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
npm ERR!     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
npm ERR!     ^
npm ERR! ../src/binding.cc:447:23: error: no matching constructor for initialization of 'String::Utf8Value'
npm ERR!     String::Utf8Value _str(in);
npm ERR!                       ^    ~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3588:5: note: candidate constructor not viable: no known conversion from 'Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
npm ERR!     Utf8Value(const Utf8Value&) = delete;
npm ERR!     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3581:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
npm ERR!     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
npm ERR!     ^
npm ERR! ../src/binding.cc:521:38: error: too few arguments to function call, single argument 'context' was not specified
npm ERR!   size_t size = info[1]->Uint32Value();
npm ERR!                 ~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3104:41: note: 'Uint32Value' declared here
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
npm ERR!                                         ^
npm ERR! ../src/binding.cc:521:10: error: no viable conversion from 'Maybe<uint32_t>' (aka 'Maybe<unsigned int>') to 'size_t' (aka 'unsigned long')
npm ERR!   size_t size = info[1]->Uint32Value();
npm ERR!          ^      ~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:550:44: error: too few arguments to function call, single argument 'context' was not specified
npm ERR!   uint32_t numZeros = info[1]->Uint32Value();
npm ERR!                       ~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3104:41: note: 'Uint32Value' declared here
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
npm ERR!                                         ^
npm ERR! ../src/binding.cc:550:12: error: no viable conversion from 'Maybe<uint32_t>' (aka 'Maybe<unsigned int>') to 'uint32_t' (aka 'unsigned int')
npm ERR!   uint32_t numZeros = info[1]->Uint32Value();
npm ERR!            ^          ~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:582:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(int8, int8_t);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:583:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(uint8, uint8_t);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:584:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(int16, int16_t);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:585:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(uint16, uint16_t);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:586:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(int32, int32_t);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:587:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(uint32, uint32_t);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:588:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(int64, int64_t);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:589:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(uint64, uint64_t);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:590:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(float, float);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! ../src/binding.cc:591:3: error: no matching member function for call to 'Set'
npm ERR!   SET_SIZEOF(double, double);
npm ERR!   ^~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cc:581:9: note: expanded from macro 'SET_SIZEOF'
npm ERR!   smap->Set(Nan::New<v8::String>( #name ).ToLocalChecked(), Nan::New<v8::Uint32>(static_cast<uint32_t>(sizeof(type))));
npm ERR!   ~~~~~~^~~
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3961:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/owen/Library/Caches/node-gyp/16.13.2/include/node/v8.h:3964:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! fatal error: too many errors emitted, stopping now [-ferror-limit=]
npm ERR! 20 errors generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.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.onExit (/Users/owen/.nodenv/versions/16.13.2/lib/node_modules/npm/node_modules/@npmcli/run-script/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 21.2.0
npm ERR! gyp ERR! command "/Users/owen/.nodenv/versions/16.13.2/bin/node" "/Users/owen/.nodenv/versions/16.13.2/lib/node_modules/npm/node_modules/@npmcli/run-script/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/owen/code/src/github.com/meroxa/node-funtime/node_modules/ref
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/owen/.npm/_logs/2022-01-26T22_09_30_799Z-debug.log

I’m on Mac:

$ sw_vers
ProductName:    macOS
ProductVersion: 12.1
BuildVersion:   21C52

I seem this bug happen only when running npm i in a non elevated shell. Work perfectly when running in powershell launching with administrator right