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

Installation failing on version-15 #382

Closed
shantanoo opened this issue Dec 21, 2024 · 1 comment
Closed

Installation failing on version-15 #382

shantanoo opened this issue Dec 21, 2024 · 1 comment

Comments

@shantanoo
Copy link

shantanoo commented Dec 21, 2024

$ bench version | grep ^frappe
frappe 15.50.0
$ node --version
v22.12.0
$ npm --version
10.9.0
$ yarn --version
1.22.22
$ uname -mors
Linux 5.15.0-118-generic x86_64 GNU/Linux
$ git log | | head -20
commit 21fdcfca839a528a92744912fe50e98a025e10ec
Author: Suraj Shetty <[email protected]>
Date:   Tue Oct 8 13:05:38 2024 +0530

    chore: Update develop version

commit 3986dff4d77c8a39d7e8b595981ee4dc7b9804dd
Merge: c29bebd 0ff12dd
Author: Maharshi Patel <[email protected]>
Date:   Mon Sep 30 13:01:35 2024 +0530

    chore: update default formats (#361)

commit 0ff12ddc2c08a0acec744227fc9f79b32571f8f0
Author: Maharshi Patel <[email protected]>
Date:   Mon Sep 30 12:49:39 2024 +0530

    chore: update default format sales_invoice_pd_format_v2

commit f65f22468a82dc6825704779eeaa49e920a73d68
$ git branch 
* develop
Exit code: 1
Command: node-pre-gyp install --fallback-to-build --update-binary
Arguments:
Directory: /frappe-bench/v15/apps/print_designer/node_modules/canvas
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
(node:1057209) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-glibc-x64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-glibc-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v127 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-glibc-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info ok
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.12 found at \"/usr/bin/python3\"

gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/usr/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 '/frappe-bench/v15/apps/print_designer/node_modules/canvas/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/frappe/.cache/node-gyp/22.12.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/frappe/.cache/node-gyp/22.12.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/frappe/.cache/node-gyp/22.12.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/frappe-bench/v15/apps/print_designer/node_modules/canvas',
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 ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/frappe-bench/v15/apps/print_designer/node_modules/canvas/build'
  SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
  COPY Release/canvas-postbuild.node
  CXX(target) Release/obj.target/canvas/src/backend/Backend.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/backend/Backend.cc:1:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../../nan/nan.h:2546:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’
 2546 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2547 |       name
      |       ~~~~
 2548 |     , getter_
      |     ~~~~~~~~~
 2549 |     , setter_
      |     ~~~~~~~~~
 2550 |     , obj
      |     ~~~~~
 2551 |     , settings
      |     ~~~~~~~~~~
 2552 |     , attribute
      |     ~~~~~~~~~~~
 2553 | #if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2554 |     , signature
      |     ~~~~~~~~~~~
 2555 | #endif
      | ~~~~~~
 2556 |   );
      |   ~
In file included from /home/frappe/.cache/node-gyp/22.12.0/include/node/v8-function.h:15,
                 from /home/frappe/.cache/node-gyp/22.12.0/include/node/v8.h:33,
                 from /home/frappe/.cache/node-gyp/22.12.0/include/node/node.h:73,
                 from ../../nan/nan.h:60,
                 from ../src/backend/Backend.h:6,
                 from ../src/backend/Backend.cc:1:
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
 1049 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
 1052 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
      |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
 1055 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
 1058 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
      |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from ../src/backend/Backend.h:6,
                 from ../src/backend/Backend.cc:1:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../../nan/nan.h:2592:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’
 2592 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2593 |       name
      |       ~~~~
 2594 |     , getter_
      |     ~~~~~~~~~
 2595 |     , setter_
      |     ~~~~~~~~~
 2596 |     , obj
      |     ~~~~~
 2597 |     , settings
      |     ~~~~~~~~~~
 2598 |     , attribute
      |     ~~~~~~~~~~~
 2599 |   );
      |   ~
In file included from /home/frappe/.cache/node-gyp/22.12.0/include/node/v8-function.h:15,
                 from /home/frappe/.cache/node-gyp/22.12.0/include/node/v8.h:33,
                 from /home/frappe/.cache/node-gyp/22.12.0/include/node/node.h:73,
                 from ../../nan/nan.h:60,
                 from ../src/backend/Backend.h:6,
                 from ../src/backend/Backend.cc:1:
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
 1049 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
 1052 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
      |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
 1055 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
 1058 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
      |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /home/frappe/.cache/node-gyp/22.12.0/include/node/v8-array-buffer.h:12,
                 from /home/frappe/.cache/node-gyp/22.12.0/include/node/v8.h:24,
                 from /home/frappe/.cache/node-gyp/22.12.0/include/node/node.h:73,
                 from ../../nan/nan.h:60,
                 from ../src/backend/Backend.h:6,
                 from ../src/backend/Backend.cc:1:
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-local-handle.h: In instantiation of ‘v8::Local<T>::Local(v8::Local<S>) [with S = v8::Data; T = v8::Value]’:
../../nan/nan_callbacks_12_inl.h:175:53:   required from here
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-local-handle.h:269:42: error: static assertion failed: type check
  269 |     static_assert(std::is_base_of<T, S>::value, \"type check\");
      |                                          ^~~~~
/home/frappe/.cache/node-gyp/22.12.0/include/node/v8-local-handle.h:269:42: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
make: *** [canvas.target.mk:163: Release/obj.target/canvas/src/backend/Backend.o] Error 1
make: Leaving directory '/frappe-bench/v15/apps/print_designer/node_modules/canvas/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:216:23)
gyp ERR! System Linux 5.15.0-118-generic
gyp ERR! command \"/usr/bin/node\" \"/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--update-binary\" \"--module=/frappe-bench/v15/apps/print_designer/node_modules/canvas/build/Release/canvas.node\" \"--module_name=canvas\" \"--module_path=/frappe-bench/v15/apps/print_designer/node_modules/canvas/build/Release\" \"--napi_version=9\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v127\"
gyp ERR! cwd /frappe-bench/v15/apps/print_designer/node_modules/canvas
gyp ERR! node -v v22.12.0
gyp ERR! node-gyp -v v10.2.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --update-binary --module=/frappe-bench/v15/apps/print_designer/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/frappe-bench/v15/apps/print_designer/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v127' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/frappe-bench/v15/apps/print_designer/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:524:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1101:16)
node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
node-pre-gyp ERR! System Linux 5.15.0-118-generic
node-pre-gyp ERR! command \"/usr/bin/node\" \"/frappe-bench/v15/apps/print_designer/node_modules/canvas/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\" \"--update-binary\"
node-pre-gyp ERR! cwd /frappe-bench/v15/apps/print_designer/node_modules/canvas
node-pre-gyp ERR! node -v v22.12.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.10
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --update-binary --module=/frappe-bench/v15/apps/print_designer/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/frappe-bench/v15/apps/print_designer/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v127' (1)"
info This module is OPTIONAL, you can safely ignore this error
Done in 5.46s.
$ bench build --app print_designer
✔ Application Assets Linked


yarn run v1.22.22
$ node esbuild --production --apps print_designer --run-build-command
✘ [ERROR] Could not resolve "canvas"

    ../print_designer/print_designer/public/js/pdf.worker.min.js:22:25511:
      22 │ ...trix(){!globalThis.DOMMatrix&&a.isNodeJS&&(globalThis.DOMMatrix=require("canvas").DOMMatrix)}();!function checkPath2D(){if(globalThis.Path2D||!a.isNode...
         ╵                                                                            ~~~~~~~~

  You can mark the path "canvas" as external to exclude it from the bundle, which will remove this
  error. You can also surround this "require" call with a try/catch block to handle this failure at
  run-time instead of bundle-time.

Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
✘ [ERROR] [plugin frappe-vue-style] Cannot read properties of undefined (reading 'outputs')

    /frappe-bench/v15/apps/frappe/esbuild/frappe-vue-style.js:10:41:
      10 │       let files = get_files(result.metafile.outputs);
         ╵                                             ^

    at /frappe-bench/v15/apps/frappe/esbuild/frappe-vue-style.js:10:42
    at /frappe-bench/v15/apps/frappe/node_modules/esbuild/lib/main.js:1052:21
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

  This error came from the "onEnd" callback registered here:

    /frappe-bench/v15/apps/frappe/esbuild/frappe-vue-style.js:9:8:
      9 │     build.onEnd((result) => {
        ╵           ~~~~~

    at setup (/frappe-bench/v15/apps/frappe/esbuild/frappe-vue-style.js:9:9)
    at handlePlugins (/frappe-bench/v15/apps/frappe/node_modules/esbuild/lib/main.js:855:23)

 ERROR  There were some problems during build

Error: Build failed with 2 errors:
../print_designer/print_designer/public/js/pdf.worker.min.js:22:25511: ERROR: Could not resolve "canvas"
/frappe-bench/v15/apps/frappe/esbuild/frappe-vue-style.js:10:41: ERROR: [plugin: frappe-vue-style] Cannot read properties of undefined (reading 'outputs')
    at failureErrorWithLog (/frappe-bench/v15/apps/frappe/node_modules/esbuild/lib/main.js:1624:15)
    at /frappe-bench/v15/apps/frappe/node_modules/esbuild/lib/main.js:1266:28
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Terminated
error Command failed with exit code 143.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/frappe-bench/v15/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/frappe-bench/v15/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/frappe-bench/v15/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/frappe-bench/v15/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/frappe-bench/v15/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/frappe-bench/v15/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/frappe-bench/v15/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/frappe-bench/v15/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/frappe-bench/v15/apps/frappe/frappe/commands/utils.py", line 77, in build
    bundle(
  File "/frappe-bench/v15/apps/frappe/frappe/build.py", line 257, in bundle
    frappe.commands.popen(command, cwd=frappe_app_path, env=get_node_env(), raise_err=True)
  File "/frappe-bench/v15/apps/frappe/frappe/commands/__init__.py", line 97, in popen
    raise subprocess.CalledProcessError(return_, command)
subprocess.CalledProcessError: Command 'yarn run production --apps print_designer --run-build-command' returned non-zero exit status 143.
ERROR: bench build --app print_designer
subprocess.CalledProcessError: Command 'bench build --app print_designer' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/frappe/.local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/commands/make.py", line 181, in get_app
    get_app(
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 777, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 254, in install
    install_app(
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 925, in install_app
    build_assets(bench_path=bench_path, app=app, using_cached=using_cached)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/bench.py", line 380, in build_assets
    exec_cmd(command, cwd=bench_path, env=env)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/__init__.py", line 178, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: bench build --app print_designer
@maharshivpatel
Copy link
Collaborator

i have decided to remove the pdfjs-dist which used canvas package as it was not providing enough benefit to manage external dependency. may add it in the future if required. #388

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