JoshuaWise / integer

Native 64-bit integers with overflow protection.
MIT License
19 stars 9 forks source link

Error when install integer #24

Closed xzhang2016 closed 4 years ago

xzhang2016 commented 4 years ago

The platform is macOS Catalina 10.15.2 node 13.6.0, npm 6.13.4

Here's the error code: % npm install integer

integer@1.0.7 install /Users/xuezhang/cwc/cwc-integ/Sbgnviz-Collaborative-Editor/node_modules/better-sqlite3/node_modules/integer node-gyp rebuild

CXX(target) Release/obj.target/integer/src/integer.o ../src/integer.cpp:329:21: error: no matching constructor for initialization of 'v8::String::Value' v8::String::Value utf16(string); ^ ~~ /Users/xuezhang/Library/Caches/node-gyp/13.6.0/include/node/v8.h:3210:5: note: candidate constructor not viable: no known conversion from 'v8::Local' to 'const v8::String::Value' for 1st argument Value(const Value&) = delete; ^ /Users/xuezhang/Library/Caches/node-gyp/13.6.0/include/node/v8.h:3203:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided Value(Isolate* isolate, Local obj); ^ 1 error generated. make: *** [Release/obj.target/integer/src/integer.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:321:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! System Darwin 19.2.0 gyp ERR! command "/usr/local/Cellar/node/13.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/xuezhang/cwc/cwc-integ/Sbgnviz-Collaborative-Editor/node_modules/better-sqlite3/node_modules/integer gyp ERR! node -v v13.6.0 gyp ERR! node-gyp -v v5.0.5 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! integer@1.0.7 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the integer@1.0.7 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/xuezhang/.npm/_logs/2020-01-10T01_37_43_352Z-debug.log

cekvenich commented 4 years ago

Let me know if running this before install fixes it: npm i -g node-gyp@latest

JoshuaWise commented 4 years ago

I probably need to update this macro:

#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 6 ||                      \
  (V8_MAJOR_VERSION == 6 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 2))
JoshuaWise commented 4 years ago

Actually, I wasn't able to reproduce this error even with the exact same versions of Node.js an NPM. For some reason, on your machine, you're missing those c++ macro definitions I printed above, or they're set to the wrong values. You may want to investigate how that could've happened.

joelcho commented 4 years ago

Remove node-gyp caches and reinstall works for me

in your case

rm  -rf /Users/xuezhang/Library/Caches/node-gyp
JoshuaWise commented 4 years ago

Try upgrading to version 4.0.0