kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
481 stars 39 forks source link

Obscure error on install #178

Closed anatoliykmetyuk closed 2 years ago

anatoliykmetyuk commented 2 years ago

I run npm i lmdb and get a long error that appears to do with C, and refers me to a log file: 2022-06-05T18_30_01_630Z-debug-0.log. The output is as follows:

``` npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed. npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates. npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x. npm WARN deprecated viz.js@2.1.2: no longer supported npm ERR! code 1 npm ERR! path /Users/kmetiuk/Projects/akmetiuk/node_modules/lmdb-store npm ERR! command failed npm ERR! command sh -c node-gyp-build npm ERR! CXX(target) Release/obj.target/lmdb/src/node-lmdb.o npm ERR! CC(target) Release/obj.target/lmdb/dependencies/lmdb/libraries/liblmdb/midl.o npm ERR! CC(target) Release/obj.target/lmdb/dependencies/lmdb/libraries/liblmdb/chacha8.o npm ERR! CC(target) Release/obj.target/lmdb/dependencies/lz4/lib/lz4.o npm ERR! CXX(target) Release/obj.target/lmdb/src/env.o npm ERR! CXX(target) Release/obj.target/lmdb/src/compression.o npm ERR! CXX(target) Release/obj.target/lmdb/src/ordered-binary.o npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@18.3.0 | darwin | x64 npm ERR! gyp info find Python using Python version 3.9.13 found at "/usr/local/opt/python@3.9/bin/python3.9" npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/usr/local/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/kmetiuk/Projects/akmetiuk/node_modules/lmdb-store/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/kmetiuk/Library/Caches/node-gyp/18.3.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/kmetiuk/Library/Caches/node-gyp/18.3.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/kmetiuk/Library/Caches/node-gyp/18.3.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/kmetiuk/Projects/akmetiuk/node_modules/lmdb-store', 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/node-lmdb.cpp:1: npm ERR! In file included from ../src/node-lmdb.h:32: npm ERR! ../../nan/nan.h:2544:8: warning: 'SetAccessor' is deprecated: Do signature check in accessor [-Wdeprecated-declarations] npm ERR! tpl->SetAccessor( npm ERR! ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8-template.h:837:3: note: 'SetAccessor' has been explicitly marked deprecated here npm ERR! V8_DEPRECATED("Do signature check in accessor") npm ERR! ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8config.h:460:35: note: expanded from macro 'V8_DEPRECATED' npm ERR! # define V8_DEPRECATED(message) [[deprecated(message)]] npm ERR! ^ npm ERR! 1 warning generated. npm ERR! In file included from ../src/env.cpp:25: npm ERR! In file included from ../src/node-lmdb.h:32: npm ERR! ../../nan/nan.h:2544:8: warning: 'SetAccessor' is deprecated: Do signature check in accessor [-Wdeprecated-declarations] npm ERR! tpl->SetAccessor( npm ERR! ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8-template.h:837:3: note: 'SetAccessor' has been explicitly marked deprecated here npm ERR! V8_DEPRECATED("Do signature check in accessor") npm ERR! ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8config.h:460:35: note: expanded from macro 'V8_DEPRECATED' npm ERR! # define V8_DEPRECATED(message) [[deprecated(message)]] npm ERR! ^ npm ERR! 1 warning generated. npm ERR! In file included from ../src/compression.cpp:26: npm ERR! In file included from ../src/node-lmdb.h:32: npm ERR! ../../nan/nan.h:2544:8: warning: 'SetAccessor' is deprecated: Do signature check in accessor [-Wdeprecated-declarations] npm ERR! tpl->SetAccessor( npm ERR! ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8-template.h:837:3: note: 'SetAccessor' has been explicitly marked deprecated here npm ERR! V8_DEPRECATED("Do signature check in accessor") npm ERR! ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8config.h:460:35: note: expanded from macro 'V8_DEPRECATED' npm ERR! # define V8_DEPRECATED(message) [[deprecated(message)]] npm ERR! ^ npm ERR! 1 warning generated. npm ERR! In file included from ../src/ordered-binary.cpp:1: npm ERR! In file included from ../src/node-lmdb.h:32: npm ERR! ../../nan/nan.h:2544:8: warning: 'SetAccessor' is deprecated: Do signature check in accessor [-Wdeprecated-declarations] npm ERR! tpl->SetAccessor( npm ERR! ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8-template.h:837:3: note: 'SetAccessor' has been explicitly marked deprecated here npm ERR! V8_DEPRECATED("Do signature check in accessor") npm ERR! ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8config.h:460:35: note: expanded from macro 'V8_DEPRECATED' npm ERR! # define V8_DEPRECATED(message) [[deprecated(message)]] npm ERR! ^ npm ERR! ../src/ordered-binary.cpp:138:92: error: too few arguments to function call, single argument 'isolate' was not specified npm ERR! Local string = Local::Cast(Local::Cast(jsKey)->Description()); npm ERR! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ npm ERR! /Users/kmetiuk/Library/Caches/node-gyp/18.3.0/include/node/v8-primitive.h:588:16: note: 'Description' declared here npm ERR! Local Description(Isolate* isolate) const; npm ERR! ^ npm ERR! 1 warning and 1 error generated. npm ERR! make: *** [Release/obj.target/lmdb/src/ordered-binary.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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Darwin 21.4.0 npm ERR! gyp ERR! command "/usr/local/Cellar/node/18.3.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /Users/kmetiuk/Projects/akmetiuk/node_modules/lmdb-store npm ERR! gyp ERR! node -v v18.3.0 npm ERR! gyp ERR! node-gyp -v v9.0.0 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! /Users/kmetiuk/.npm/_logs/2022-06-05T18_30_01_630Z-debug-0.log ```

My Mac specs:

MacBook Pro 15' 2017 macOS Monterey 12.3.1 Node 8.11.0 Xcode 13.4, build version 13F17a

kriszyp commented 2 years ago

@anatoliykmetyuk I am not sure exactly what version you are installing, but this appears to be a a very old version of this package (this referenced files that are no longer used, line numbers are gone, and the name of the package "lmdb-store" has changed since then).

anatoliykmetyuk commented 2 years ago

The same problem manifests when I do "npm i lmdb"... Any idea why it might be trying to pick the old version or the old file?

anatoliykmetyuk commented 2 years ago

I managed to solve the problem. It was caused in the context of a GatsbyJS website, turns out that my invoking the commands from its directory mattered. Invoking the commands from an empty directory worked fine. In the website, turns out that I had a bunch of dependencies specified in package.json and one of them depended on lmdb. However for some reason the order in which the dependencies were installed mattered: when I invoked npm i in my website directory it failed with this error. However when I edited the file to disable all dependencies, then enabled some of them and installed, then enabled even more etc – this gradual approach worked...