Geoxor / Naoko

Naoko is my main Discord Bot
GNU General Public License v3.0
15 stars 16 forks source link

yarn install fails #158

Closed otiskujawa closed 1 year ago

otiskujawa commented 1 year ago

python 3.11.3

$ yarn install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
warning Pattern ["wrap-ansi@^7.0.0"] is trying to unpack in the same destination "/home/otiskujawa/.cache/yarn/v6/npm-wrap-ansi-cjs-7.0.0-67e145cff510a6a6984bdf1152911d69d2eb9e43-integrity/node_modules/wrap-ansi-cjs" as pattern ["wrap-ansi-cjs@npm:wrap-ansi@^7.0.0"]. This could result in non-deterministic behavior, skipping.
[3/4] Linking dependencies...
warning " > @jimp/plugin-fisheye@0.22.8" has unmet peer dependency "@jimp/custom@>=0.3.5".
warning " > ts-node@10.9.1" has unmet peer dependency "@types/node@*".
[4/4] Building fresh packages...
[1/4] ⠂ @discordjs/opus
[2/4] ⠂ canvas
[3/4] ⠂ node
error /home/otiskujawa/Documents/git/Naokoc/node_modules/gl: Command failed.
Exit code: 1
Command: prebuild-install || node-gyp rebuild
Arguments: 
Directory: /home/otiskujawa/Documents/git/Naokoc/node_modules/gl
Output:
prebuild-install WARN install No prebuilt binaries found (target=18.9.0 runtime=node arch=x64 libc= platform=linux)
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@18.9.0 | linux | x64
gyp info find Python using Python version 3.11.3 found at "/usr/bin/python3"
(node:12821) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/home/otiskujawa/Documents/git/Naokoc/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   '/home/otiskujawa/Documents/git/Naokoc/node_modules/gl/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/otiskujawa/.cache/node-gyp/18.9.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/otiskujawa/.cache/node-gyp/18.9.0',
gyp info spawn args   '-Dnode_gyp_dir=/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/otiskujawa/.cache/node-gyp/18.9.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/otiskujawa/Documents/git/Naokoc/node_modules/gl',
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 ]
Traceback (most recent call last):
  File "/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/gyp/gyp_main.py", line 51, in <module>
    sys.exit(gyp.script_main())
             ^^^^^^^^^^^^^^^^^
  File "/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 670, in script_main
    return main(sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^
  File "/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 662, in main
    return gyp_main(args)
           ^^^^^^^^^^^^^^
  File "/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 629, in gyp_main
    [generator, flat_list, targets, data] = Load(
                                            ^^^^^
  File "/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 150, in Load
    result = gyp.input.Load(
             ^^^^^^^^^^^^^^^
  File "/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 3021, in Load
    LoadTargetBuildFile(
  File "/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 411, in LoadTargetBuildFile
    build_file_data = LoadOneBuildFile(
                      ^^^^^^^^^^^^^^^^^
  File "/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 239, in LoadOneBuildFile
    build_file_contents = open(build_file_path, "rU").read()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU' 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 (/home/otiskujawa/Documents/git/Naokoc/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 6.3.5-arch1-1
gyp ERR! command "/home/otiskujawa/.nvm/versions/node/v18.9.0/bin/node" "/home/otiskujawa/Documents/git/Naokoc/node_modules/gl/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/otiskujawa/Documents/git/Naokoc/node_modules/gl
gyp ERR! node -v v18.9.0
otiskujawa commented 1 year ago

this is issue related to python version in clean system with python 3.10.10 it gives same error as #159

# yarn install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
warning Pattern ["wrap-ansi@^7.0.0"] is trying to unpack in the same destination "/usr/local/share/.cache/yarn/v6/npm-wrap-ansi-cjs-7.0.0-67e145cff510a6a6984bdf1152911d69d2eb9e43-integrity/node_modules/wrap-ansi-cjs" as pattern ["wrap-ansi-cjs@npm:wrap-ansi@^7.0.0"]. This could result in non-deterministic behavior, skipping.
[3/4] Linking dependencies...
warning " > @jimp/plugin-fisheye@0.22.8" has unmet peer dependency "@jimp/custom@>=0.3.5".
warning " > ts-node@10.9.1" has unmet peer dependency "@types/node@*".
[4/4] Building fresh packages...
[1/4] ⡀ @discordjs/opus
[2/4] ⡀ canvas
[3/4] ⡀ node
error /home/otis/Naoko/node_modules/gl: Command failed.
Exit code: 7
Command: prebuild-install || node-gyp rebuild
Arguments: 
Directory: /home/otis/Naoko/node_modules/gl
Output:
prebuild-install WARN install No prebuilt binaries found (target=20.3.0 runtime=node arch=x64 libc= platform=linux)
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@20.3.0 | linux | x64
gyp info find Python using Python version 3.10.10 found at "/usr/bin/python3"
gyp http GET https://nodejs.org/download/release/v20.3.0/node-v20.3.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v20.3.0/node-v20.3.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v20.3.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v20.3.0/SHASUMS256.txt
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
gyp ERR! stack     at createConfigFile (/home/otis/Naoko/node_modules/node-gyp/lib/configure.js:117:21)
gyp ERR! stack     at /home/otis/Naoko/node_modules/node-gyp/lib/configure.js:84:9
gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:188:23)
gyp ERR! System Linux 6.3.5-arch1-1
gyp ERR! command "/usr/bin/node" "/home/otis/Naoko/node_modules/gl/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/otis/Naoko/node_modules/gl
gyp ERR! node -v v20.3.0
gyp ERR! node-gyp -v v7.1.2
Its-treason commented 1 year ago

This is an Issue with node-canvas-webgl still depending on gl version 4.9 and version of python, node or nodegyp being too new. The version is updated in their repo: https://github.com/akira-cn/node-canvas-webgl/pull/11, but that version is not published.

For easy installing, you can the Docker image by running docker compose run --rm -it node-cli yarn install, but because of the Debian bookworm release and me being dumb, not pinning the image version, you need a small change to the Dockerfile:

-FROM node:18
+FROM node:18-bullseye

 USER root

 RUN apt update \
  && apt install -y build-essential g++-10 libxi-dev libxext-dev libpixman-1-dev libcairo2-dev libpango1.0-dev libjpeg62-turbo-dev libgif-dev libjpeg-dev librsvg2-dev mesa-common-dev \
  && ln -s /usr/bin/python3 /usr/bin/python
otiskujawa commented 1 year ago

is this possible to fix this issue by using this fork? https://www.npmjs.com/package/@lumen5/node-canvas-webgl