'SQLite3 with Electron 13
Currently trying to use sqlite3 with electron 13.1 and Node 14.17.3.
Running electron-forge start results in:
/home/victor/workplace/project/node_modules/node-addon-api/napi-inl.h: In member function ‘bool Napi::Object::Freeze()’:
/home/victor/workplace/project/node_modules/node-addon-api/napi-inl.h:1393:24: error: ‘napi_object_freeze’ was not declared in this scope; did you mean ‘napi_object_expected’?
1393 | napi_status status = napi_object_freeze(_env, _value);
| ^~~~~~~~~~~~~~~~~~
| napi_object_expected
/home/victor/workplace/project/node_modules/node-addon-api/napi-inl.h: In member function ‘bool Napi::Object::Seal()’:
/home/victor/workplace/project/node_modules/node-addon-api/napi-inl.h:1399:24: error: ‘napi_object_seal’ was not declared in this scope; did you mean ‘napi_object’?
1399 | napi_status status = napi_object_seal(_env, _value);
| ^~~~~~~~~~~~~~~~
| napi_object
⠴ Building module: sqlite3, Completed: 0../src/b
Looking at the readme of SQLite here, it seems like support for Electron 13.1 is not available.
Is there any known workaround (that I could not find) or even another (compatible) package?
Solution 1:[1]
I solved this by overriding the sqlite node-addon-api dependency. If you are using yarn, you can add the following lines to the package.json file:
"resolutions": {
"sqlite3/node-addon-api": "3.1.0" }
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Iman |
