charmverse / app.charmverse.io

All-in-one DAO Operations Platform
https://charmverse.io
Other
57 stars 21 forks source link

Following Readme on main branch fails to build. #4866

Open kempy007 opened 2 days ago

kempy007 commented 2 days ago

Following Readme on main branch fails to build.

I expected the build steps to succeed and for the App to start.

I started a container with 'docker run -it node:20.18.0-slim /bin/bash' and executed the steps from readme.

cmd history

root@d0384102ea15:/app/app.charmverse.io# history           
    1  git
    2  apt install git
    3  apt update
    4  apt install git
    5  pwd
    6  mkdir app
    7  cd app
    8  git clone git@github.com:charmverse/app.charmverse.io.git
    9  git clone https://github.com/charmverse/app.charmverse.io.git
   10  cd app.charmverse.io/
   11  nano .env.example
   12  apt install nano
   13  nano .env.example
   14  apt install openssl -y
   15  apt install python3 -y
   16  export PYTHON=/bin/python3
   17  apt install node-gyp -y
   18  node-gyp configure
   19  npm ci
   20  history

Shell Output

...missing_some_output...
root@d0384102ea15:/app/app.charmverse.io# node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.0
gyp info using node@20.18.0 | linux | x64
gyp info find Python using Python version 3.11.2 found at "/bin/python3"
gyp info spawn /bin/python3
gyp info spawn args [
gyp info spawn args   '/usr/share/nodejs/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   '/app/app.charmverse.io/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/share/nodejs/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/include/nodejs/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/usr/include/nodejs',
gyp info spawn args   '-Dnode_gyp_dir=/usr/share/nodejs/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/usr/include/nodejs/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/app/app.charmverse.io',
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: binding.gyp not found (cwd: /app/app.charmverse.io) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/nodejs/node-gyp/lib/configure.js:329:16)
gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Linux 6.1.100+
gyp ERR! command "/usr/local/bin/node" "/usr/bin/node-gyp" "configure"
gyp ERR! cwd /app/app.charmverse.io
gyp ERR! node -v v20.18.0
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok

root@d0384102ea15:/app/app.charmverse.io# npm ci
npm warn deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated prosemirror@0.11.1: This library has been split up into separate modules. This is the old monolithic package, which is no longer maintained. Use prosemirror-view, prosemirror-model, etc instead.
npm warn deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm warn deprecated micro-base@0.9.0: Switch to @scure/base for audited version of the lib & updates
npm warn deprecated glob@7.2.0: Glob versions prior to v9 are no longer supported
npm warn deprecated svgdom@0.1.16: This version has a crucial bug that will error. Use 0.1.14 instead
npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm warn deprecated ipfs-core-utils@0.18.1: js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @types/react-pdf@7.0.0: This is a stub types definition. react-pdf provides its own type definitions, so you do not need this installed.
npm warn deprecated ipfs-core-types@0.14.1: js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details
npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated ipfs-http-client@60.0.1: js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details
npm warn deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated npmlog@6.0.2: This package is no longer supported.
npm warn deprecated are-we-there-yet@3.0.1: This package is no longer supported.
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated gauge@4.0.4: This package is no longer supported.
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
npm warn deprecated @aws-cdk/aws-apigatewayv2-alpha@2.21.1-alpha.0: This package has been stabilized and moved to aws-cdk-lib
npm warn deprecated multibase@4.0.6: This module has been superseded by the multiformats module
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     '/app/app.charmverse.io/node_modules/tree-sitter-yaml',
npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/app/app.charmverse.io/node_modules/tree-sitter-yaml'] {
npm warn cleanup       errno: -39,
npm warn cleanup       code: 'ENOTEMPTY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '/app/app.charmverse.io/node_modules/tree-sitter-yaml'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '/app/app.charmverse.io/node_modules',
npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/app/app.charmverse.io/node_modules/tree-sitter-yaml'] {
npm warn cleanup       errno: -39,
npm warn cleanup       code: 'ENOTEMPTY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '/app/app.charmverse.io/node_modules/tree-sitter-yaml'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path /app/app.charmverse.io/node_modules/ffi-napi
npm error command failed
npm error command sh -c node-gyp-build
npm error make: Entering directory '/app/app.charmverse.io/node_modules/ffi-napi/build'
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/types.o
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/raw_api.o
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/java_raw_api.o
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/closures.o
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/x86/ffiw64.o
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/x86/ffi64.o
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/x86/unix64.o
npm error   CC(target) Release/obj.target/ffi/deps/libffi/src/x86/win64.o
npm error   AR(target) Release/obj.target/deps/libffi/libffi.a
npm error   COPY Release/libffi.a
npm error   CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
npm error   AR(target) Release/obj.target/node_modules/node-addon-api/nothing.a
npm error   COPY Release/nothing.a
npm error   CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
npm error make: Leaving directory '/app/app.charmverse.io/node_modules/ffi-napi/build'
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@8.4.1
npm error gyp info using node@20.18.0 | linux | x64
npm error gyp info find Python using Python version 3.11.2 found at "/bin/python3"
npm error gyp http GET https://nodejs.org/download/release/v20.18.0/node-v20.18.0-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v20.18.0/node-v20.18.0-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v20.18.0/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v20.18.0/SHASUMS256.txt
npm error gyp info spawn /bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args   '/app/app.charmverse.io/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args   'binding.gyp',
npm error gyp info spawn args   '-f',
npm error gyp info spawn args   'make',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/app/app.charmverse.io/node_modules/ffi-napi/build/config.gypi',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/app/app.charmverse.io/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/root/.cache/node-gyp/20.18.0/include/node/common.gypi',
npm error gyp info spawn args   '-Dlibrary=shared_library',
npm error gyp info spawn args   '-Dvisibility=default',
npm error gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/20.18.0',
npm error gyp info spawn args   '-Dnode_gyp_dir=/app/app.charmverse.io/node_modules/node-gyp',
npm error gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/20.18.0/<(target_arch)/node.lib',
npm error gyp info spawn args   '-Dmodule_root_dir=/app/app.charmverse.io/node_modules/ffi-napi',
npm error gyp info spawn args   '-Dnode_engine=v8',
npm error gyp info spawn args   '--depth=.',
npm error gyp info spawn args   '--no-parallel',
npm error gyp info spawn args   '--generator-output',
npm error gyp info spawn args   'build',
npm error gyp info spawn args   '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error ../deps/libffi/src/java_raw_api.c: In function 'ffi_java_raw_call':
npm error ../deps/libffi/src/java_raw_api.c:317:3: warning: 'ffi_java_raw_to_ptrarray' is deprecated [-Wdeprecated-declarations]
npm error   317 |   ffi_java_raw_to_ptrarray (cif, raw, avalue);
npm error       |   ^~~~~~~~~~~~~~~~~~~~~~~~
npm error ../deps/libffi/src/java_raw_api.c:76:1: note: declared here
npm error    76 | ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
npm error       | ^~~~~~~~~~~~~~~~~~~~~~~~
npm error ../deps/libffi/src/java_raw_api.c: In function 'ffi_java_translate_args':
npm error ../deps/libffi/src/java_raw_api.c:328:3: warning: 'ffi_java_raw_size' is deprecated [-Wdeprecated-declarations]
npm error   328 |   ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
npm error       |   ^~~~~~~~~~~~
npm error ../deps/libffi/src/java_raw_api.c:45:1: note: declared here
npm error    45 | ffi_java_raw_size (ffi_cif *cif)
npm error       | ^~~~~~~~~~~~~~~~~
npm error ../deps/libffi/src/java_raw_api.c:331:3: warning: 'ffi_java_ptrarray_to_raw' is deprecated [-Wdeprecated-declarations]
npm error   331 |   ffi_java_ptrarray_to_raw (cif, avalue, raw);
npm error       |   ^~~~~~~~~~~~~~~~~~~~~~~~
npm error ../deps/libffi/src/java_raw_api.c:157:1: note: declared here
npm error   157 | ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw)
npm error       | ^~~~~~~~~~~~~~~~~~~~~~~~
npm error ../deps/libffi/src/java_raw_api.c: In function 'ffi_prep_java_raw_closure':
npm error ../deps/libffi/src/java_raw_api.c:369:3: warning: 'ffi_prep_java_raw_closure_loc' is deprecated [-Wdeprecated-declarations]
npm error   369 |   return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl);
npm error       |   ^~~~~~
npm error ../deps/libffi/src/java_raw_api.c:337:1: note: declared here
npm error   337 | ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl,
npm error       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../deps/libffi/src/closures.c: In function 'allocate_space':
npm error ../deps/libffi/src/closures.c:748:29: warning: comparison of integer expressions of different signedness: 'off_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
npm error   748 |       off_t to_write = (len < page_size) ? len : page_size;
npm error       |                             ^
npm error ../deps/libffi/src/closures.c:748:44: warning: operand of '?:' changes signedness from 'off_t' {aka 'long int'} to 'size_t' {aka 'long unsigned int'} due to unsignedness of other operand [-Wsign-compare]
npm error   748 |       off_t to_write = (len < page_size) ? len : page_size;
npm error       |                                            ^~~
npm error ../deps/libffi/src/x86/ffi64.c: In function 'classify_argument':
npm error ../deps/libffi/src/x86/ffi64.c:200:25: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
npm error   200 |           FFI_ASSERT (0);
npm error       |                         ^
npm error ../deps/libffi/src/x86/ffi64.c:175:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm error   175 |       {
npm error       |       ^
npm error ../deps/libffi/src/x86/ffi64.c:202:5: note: here
npm error   202 |     case FFI_TYPE_FLOAT:
npm error       |     ^~~~
npm error In file included from ../src/ffi.cc:5:
npm error /app/app.charmverse.io/node_modules/get-uv-event-loop-napi-h/include/get-uv-event-loop-napi.h: In function 'uv_loop_t* get_uv_event_loop(napi_env)':
npm error /app/app.charmverse.io/node_modules/get-uv-event-loop-napi-h/include/get-uv-event-loop-napi.h:26:30: error: invalid conversion from 'napi_status (*)(node_api_basic_env, uv_loop_s**)' {aka 'napi_status (*)(const napi_env__*, uv_loop_s**)'} to 'get_uv_event_loop_fn' {aka 'napi_status (*)(napi_env__*, uv_loop_s**)'} [-fpermissive]
npm error    26 |   napi_get_uv_event_loop__ = &napi_get_uv_event_loop;
npm error       |                              ^~~~~~~~~~~~~~~~~~~~~~~
npm error       |                              |
npm error       |                              napi_status (*)(node_api_basic_env, uv_loop_s**) {aka napi_status (*)(const napi_env__*, uv_loop_s**)}
npm error In file included from /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi.h:2725,
npm error                  from ../src/ffi.h:2,
npm error                  from ../src/ffi.cc:3:
npm error /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi-inl.h: In instantiation of 'napi_status Napi::details::AttachData(napi_env, napi_value, FreeType*, napi_finalize, void*) [with FreeType = CallbackData<Napi::Value (*)(const Napi::CallbackInfo&), Napi::Value>; napi_env = napi_env__*; napi_value = napi_value__*; napi_finalize = void (*)(napi_env__*, void*, void*)]':
npm error /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi-inl.h:1965:39:   required from 'napi_status Napi::CreateFunction(napi_env, const char*, napi_callback, CbData*, napi_value__**) [with CbData = details::CallbackData<Value (*)(const CallbackInfo&), Value>; napi_env = napi_env__*; napi_callback = napi_value__* (*)(napi_env__*, napi_callback_info__*); napi_value = napi_value__*]'
npm error /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi-inl.h:2021:38:   required from 'static Napi::Function Napi::Function::New(napi_env, Callable, const char*, void*) [with Callable = Napi::Value (*)(const Napi::CallbackInfo&); napi_env = napi_env__*]'
npm error ../src/ffi.cc:58:41:   required from here
npm error /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi-inl.h:63:47: error: invalid conversion from 'napi_finalize' {aka 'void (*)(napi_env__*, void*, void*)'} to 'node_api_basic_finalize' {aka 'void (*)(const napi_env__*, void*, void*)'} [-fpermissive]
npm error    63 |   status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr);
npm error       |                                               ^~~~~~~~~
npm error       |                                               |
npm error       |                                               napi_finalize {aka void (*)(napi_env__*, void*, void*)}
npm error In file included from /root/.cache/node-gyp/20.18.0/include/node/node_api.h:12,
npm error                  from /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi.h:4:
npm error /root/.cache/node-gyp/20.18.0/include/node/js_native_api.h:528:44: note:   initializing argument 4 of 'napi_status napi_add_finalizer(napi_env, napi_value, void*, node_api_basic_finalize, void*, napi_ref__**)'
npm error   528 |                    node_api_basic_finalize finalize_cb,
npm error       |                    ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
npm error /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi-inl.h: In instantiation of 'napi_status Napi::details::AttachData(napi_env, napi_value, FreeType*, napi_finalize, void*) [with FreeType = CallbackData<void (*)(const Napi::CallbackInfo&), void>; napi_env = napi_env__*; napi_value = napi_value__*; napi_finalize = void (*)(napi_env__*, void*, void*)]':
npm error /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi-inl.h:1965:39:   required from 'napi_status Napi::CreateFunction(napi_env, const char*, napi_callback, CbData*, napi_value__**) [with CbData = details::CallbackData<void (*)(const CallbackInfo&), void>; napi_env = napi_env__*; napi_callback = napi_value__* (*)(napi_env__*, napi_callback_info__*); napi_value = napi_value__*]'
npm error /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi-inl.h:2021:38:   required from 'static Napi::Function Napi::Function::New(napi_env, Callable, const char*, void*) [with Callable = void (*)(const Napi::CallbackInfo&); napi_env = napi_env__*]'
npm error ../src/ffi.cc:60:37:   required from here
npm error /app/app.charmverse.io/node_modules/ffi-napi/node_modules/node-addon-api/napi-inl.h:63:47: error: invalid conversion from 'napi_finalize' {aka 'void (*)(napi_env__*, void*, void*)'} to 'node_api_basic_finalize' {aka 'void (*)(const napi_env__*, void*, void*)'} [-fpermissive]
npm error    63 |   status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr);
npm error       |                                               ^~~~~~~~~
npm error       |                                               |
npm error       |                                               napi_finalize {aka void (*)(napi_env__*, void*, void*)}
npm error /root/.cache/node-gyp/20.18.0/include/node/js_native_api.h:528:44: note:   initializing argument 4 of 'napi_status napi_add_finalizer(napi_env, napi_value, void*, node_api_basic_finalize, void*, napi_ref__**)'
npm error   528 |                    node_api_basic_finalize finalize_cb,
npm error       |                    ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
npm error make: *** [ffi_bindings.target.mk:121: Release/obj.target/ffi_bindings/src/ffi.o] Error 1
npm error gyp ERR! build error
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack     at ChildProcess.onExit (/app/app.charmverse.io/node_modules/node-gyp/lib/build.js:194:23)
npm error gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm error gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Linux 6.1.100+
npm error gyp ERR! command "/usr/local/bin/node" "/app/app.charmverse.io/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /app/app.charmverse.io/node_modules/ffi-napi
npm error gyp ERR! node -v v20.18.0
npm error gyp ERR! node-gyp -v v8.4.1
npm error gyp ERR! not ok
npm notice
npm notice New minor version of npm available! 10.8.2 -> 10.9.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.0
npm notice To update run: npm install -g npm@10.9.0
npm notice
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-10-21T20_05_15_211Z-debug-0.log
root@d0384102ea15:/app/app.charmverse.io#
kempy007 commented 2 days ago

@ccarella can you help us pls thx

mattcasey commented 1 day ago

Hi @kempy007 the README Is a little out of date, and we actually do not use Docker for development - only deployment and CI. Unfortunately we do not have the capacity to ensure that it is easy to run the application locally, but i'd like to offer some general steps that should work:

1) You need a local postgres db running with a "charmverse" database. Also install node.js if you haven't already. I'm using node v20.11.1 and npm v10. 2) In this repo, copy the .env.test.local.example file to .env.local and rename "charmversetest" to "charmverse" in the DATABASE_URL. Then run npm ci and then run dotenv -e .env.local -- npm run prisma:migrate to set up the db. You should be able to run npm start. to get the Next.js server started and at least see a login page. To get the app working, you must also have the permissions api running: 3) Clone a copy of https://github.com/charmverse/permissions.charmverse.io. I just added you as a contributor so you should be able to see it. Create a .env.local file similar to the first one, and run npm start.