Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better-sqlite3 error when running Yarn on Github Codespace #183

Open
letuhuy opened this issue Feb 18, 2023 · 2 comments
Open

better-sqlite3 error when running Yarn on Github Codespace #183

letuhuy opened this issue Feb 18, 2023 · 2 comments

Comments

@letuhuy
Copy link

letuhuy commented Feb 18, 2023

Using Github Codespace.
When I run Yarn, I get the following better-sqlite3 installation error:

yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "sourcecred > @date-io/[email protected]" has incorrect peer dependency "[email protected]".
warning "sourcecred > @material-ui/[email protected]" has unmet peer dependency "@date-io/core@^1.3.6".
warning "sourcecred > @material-ui/[email protected]" has unmet peer dependency "prop-types@^15.6.0".
warning "sourcecred > [email protected]" has unmet peer dependency "connected-react-router@^6.5.2".
warning "sourcecred > [email protected]" has unmet peer dependency "final-form@^4.20.2".
warning "sourcecred > [email protected]" has unmet peer dependency "react-final-form@^6.5.2".
warning "sourcecred > [email protected]" has unmet peer dependency "react-redux@^7.1.0".
warning "sourcecred > [email protected]" has unmet peer dependency "redux@^3.7.2 || ^4.0.3".
warning "sourcecred > [email protected]" has unmet peer dependency "redux-saga@^1.0.0".
warning "sourcecred > [email protected]" has unmet peer dependency "@material-ui/styles@^4.11.2".
warning "sourcecred > [email protected]" has unmet peer dependency "final-form@^4.20.2".
warning "sourcecred > [email protected]" has unmet peer dependency "final-form-arrays@^3.0.2".
warning "sourcecred > [email protected]" has unmet peer dependency "react-final-form@^6.5.2".
warning "sourcecred > [email protected]" has unmet peer dependency "react-final-form-arrays@^3.1.3".
warning "sourcecred > [email protected]" has unmet peer dependency "react-redux@^7.1.0".
warning "sourcecred > [email protected]" has unmet peer dependency "redux@^3.7.2 || ^4.0.3".
warning "sourcecred > ra-ui-materialui > [email protected]" has unmet peer dependency "immutable@^3.8.1 || ^4.0.0-rc.1".
warning "sourcecred > ra-ui-materialui > [email protected]" has incorrect peer dependency "history@^4.7.2".
warning "sourcecred > ra-ui-materialui > [email protected]" has unmet peer dependency "react-redux@^6.0.0 || ^7.1.0".
warning "sourcecred > ra-ui-materialui > [email protected]" has unmet peer dependency "redux@^3.6.0 || ^4.0.0".
warning "sourcecred > ra-ui-materialui > [email protected]" has unmet peer dependency "seamless-immutable@^7.1.3".
warning "sourcecred > web3modal > [email protected]" has unmet peer dependency "react-is@>= 16.8.0".
warning "sourcecred > @walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "sourcecred > @walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > [email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "sourcecred > @walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > [email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "sourcecred > @walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > [email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "sourcecred > @walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-corejs2 > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.4.0-0".
warning "sourcecred > @walletconnect/web3-provider > web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-corejs2 > @babel/helper-define-polyfill-provider > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
[4/4] Building fresh packages...
[-/4] ⢀ waiting...
[-/4] ⠠ waiting...
[-/4] ⠠ waiting...
error /workspaces/template-instance/node_modules/better-sqlite3: Command failed.
Exit code: 1
Command: prebuild-install || npm run build-release
Arguments:
Directory: /workspaces/template-instance/node_modules/better-sqlite3
Output:
prebuild-install WARN install No prebuilt binaries found (target=19.6.0 runtime=node arch=x64 libc= platform=linux)

[email protected] build-release
node-gyp rebuild --release

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.10.4 found at "/home/codespace/.python/current/bin/python3"
gyp info spawn /home/codespace/.python/current/bin/python3
gyp info spawn args [
gyp info spawn args '/usr/local/share/nvm/versions/node/v19.6.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/workspaces/template-instance/node_modules/better-sqlite3/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/share/nvm/versions/node/v19.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/codespace/.cache/node-gyp/19.6.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/codespace/.cache/node-gyp/19.6.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/share/nvm/versions/node/v19.6.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/codespace/.cache/node-gyp/19.6.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/workspaces/template-instance/node_modules/better-sqlite3',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/workspaces/template-instance/node_modules/better-sqlite3/build'
TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
TOUCH Release/obj.target/deps/locate_sqlite3.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
rm -f Release/obj.target/deps/sqlite3.a Release/obj.target/deps/sqlite3.a.ar-file-list; mkdir -p dirname Release/obj.target/deps/sqlite3.a
ar crs Release/obj.target/deps/sqlite3.a @Release/obj.target/deps/sqlite3.a.ar-file-list
COPY Release/sqlite3.a
CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
In file included from ./src/better_sqlite3.lzz:10,
from ../src/better_sqlite3.cpp:4:
/home/codespace/.cache/node-gyp/19.6.0/include/node/node.h:1013:51: warning: cast between incompatible function types from ‘void ()(v8::Localv8::Object, v8::Localv8::Value, v8::Localv8::Context)’ to ‘node::addon_context_register_func’ {aka ‘void ()(v8::Localv8::Object, v8::Localv8::Value, v8::Localv8::Context, void*)’} [-Wcast-function-type]
1013 | (node::addon_context_register_func) (regfunc),
| ^
/home/codespace/.cache/node-gyp/19.6.0/include/node/node.h:1031:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE_X’
1031 | NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/codespace/.cache/node-gyp/19.6.0/include/node/node.h:1062:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE’
1062 | NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
./src/better_sqlite3.lzz:67:1: note: in expansion of macro ‘NODE_MODULE_INIT’
./src/util/macros.lzz: In function ‘void SetPrototypeGetter(v8::Isolate*, v8::Localv8::External, v8::Localv8::FunctionTemplate, const char*, v8::AccessorGetterCallback)’:
./src/util/macros.lzz:173:21: error: ‘v8::AccessorSignature’ has not been declared
./src/util/binder.lzz: In static member function ‘static bool Binder::IsPlainObject(v8::Isolate*, v8::Localv8::Object)’:
./src/util/binder.lzz:36:51: error: ‘class v8::Object’ has no member named ‘CreationContext’; did you mean ‘GetCreationContext’?
./src/util/data.lzz: In function ‘v8::Localv8::Value Data::GetValueJS(v8::Isolate*, sqlite3_stmt*, int, bool)’:
./src/util/data.lzz:75:92: warning: this statement may fall through [-Wimplicit-fallthrough=]
./src/util/data.lzz:75:197: note: here
./src/util/data.lzz: In function ‘v8::Localv8::Value Data::GetValueJS(v8::Isolate*, sqlite3_value*, bool)’:
./src/util/data.lzz:79:81: warning: this statement may fall through [-Wimplicit-fallthrough=]
./src/util/data.lzz:79:175: note: here
make: *** [better_sqlite3.target.mk:125: Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
make: Leaving directory '/workspaces/template-instance/node_modules/better-sqlite3/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/share/nvm/versions/node/v19.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:512:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Linux 5.4.0-1103-azure
gyp ERR! command "/usr/local/share/nvm/versions/node/v19.6.0/bin/node" "/usr/local/share/nvm/versions/node/v19.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /workspaces/template-instance/node_modules/better-sqlite3
gyp ERR! node -v v19.6.0

Any ideas?

@hozzjss
Copy link
Contributor

hozzjss commented Feb 19, 2023

I would say try switching node version to 16 or 18 until it works, if not i can give it a look

@letuhuy
Copy link
Author

letuhuy commented Feb 20, 2023

I would say try switching node version to 16 or 18 until it works, if not i can give it a look

Thanks for the suggestion @hozzjss--switching to node version 18 allowed me to run the yarn command!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants