kriszyp / lmdb-js

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

Build errors with new Parcel install #204

Closed joospotter closed 1 year ago

joospotter commented 1 year ago

I'm having an issue getting lmdb-store to build as part of a Parcel requirement on my new environment.

This is the relevant part of the build error log:

C:\node\KEPT-Backend\node_modules\nan\nan.h(2544,6): warning C4996: 'v8::ObjectTemplate::SetAccessor': Do signature check in accessor [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] env.cpp C:\node\KEPT-Backend\node_modules\nan\nan.h(2544,6): warning C4996: 'v8::ObjectTemplate::SetAccessor': Do signature check in accessor [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] compression.cpp C:\node\KEPT-Backend\node_modules\nan\nan.h(2544,6): warning C4996: 'v8::ObjectTemplate::SetAccessor': Do signature check in accessor [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] ordered-binary.cpp C:\node\KEPT-Backend\node_modules\nan\nan.h(2544,6): warning C4996: 'v8::ObjectTemplate::SetAccessor': Do signature check in accessor [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] C:\node\KEPT-Backend\node_modules\lmdb-store\src\ordered-binary.cpp(138,78): error C2660: 'v8::Symbol::Description': function does not take 0 arguments [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] C:\Users\joosp\AppData\Local\node-gyp\Cache\18.12.1\include\node\v8-primitive.h(588,16): message : see declaration of 'v8::Symbol::Description' [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] C:\node\KEPT-Backend\node_modules\lmdb-store\src\ordered-binary.cpp(138,78): message : while trying to match the argument list '()' [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] C:\node\KEPT-Backend\node_modules\lmdb-store\src\ordered-binary.cpp(138,47): error C2672: 'v8::Local<v8::String>::Cast': no matching overloaded function found [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] C:\Users\joosp\AppData\Local\node-gyp\Cache\18.12.1\include\node\v8-local-handle.h(236,29): message : could be 'v8::Local<v8::String> v8::Local<v8::String>::Cast(v8::Local<S>)' [C:\node\KEPT-Backend\node_modules\lmdb-store\build\lmdb-store.vcxproj] gyp ERR! build error gyp ERR! stack Error:C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exefailed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:201:23) gyp ERR! stack at ChildProcess.emit (node:events:513:28) gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)

Stack is

Do I need to downgrade to an older version of node for this to work? Seems like the error messages are all v8 related.

kriszyp commented 1 year ago

@joospotter do you know which version of Parcel and lmdb-store you are using?

lemonad commented 1 year ago

[Edit: npm install lmdb actually works fine so this looks like an upstream issue?]

Also coming from Parcel so posting here but just running npm install lmdb-store in an empty directory results in an unsuccessful build: see build log

kriszyp commented 1 year ago

Yeah, the most likely answer is that yes, if you are using an old version of lmdb-js, you will probably need an older version of node. Updates/fixes for later versions of node have been in later versions of lmdb-js for quite a while.

joospotter commented 1 year ago

It appears that the project was using rc2.0.0, but upgrading it directly did not fix the issue - uninstalling all additional modules to parcel and then uninstall parcel itself from the project then reinstalling the latest version has it now building successfully however.