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

gd_errors.h? #102

Open
Pinny3 opened this issue Jul 24, 2023 · 1 comment
Open

gd_errors.h? #102

Pinny3 opened this issue Jul 24, 2023 · 1 comment

Comments

@Pinny3
Copy link

Pinny3 commented Jul 24, 2023

Question:

In

https://github.com/y-a-v-a/node-gd/blob/master/src/node_gd.cc

the file

gd_errors.h

is referenced but it seems there is no file called gd_errors.h in the repo. Is this file missing by accident?

When I do a

npm install

on a LinuxKit environment I got this error:

#0 5.109 npm notice 
#0 5.109 npm notice New minor version of npm available! 9.5.1 -> 9.8.1
#0 5.109 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.8.1>
#0 5.109 npm notice Run `npm install -g [email protected]` to update!
#0 5.109 npm notice 
#0 5.110 npm ERR! code 1
#0 5.110 npm ERR! path /var/task/node_modules/node-gd
#0 5.111 npm ERR! command failed
#0 5.111 npm ERR! command sh -c node-gyp rebuild -j max
#0 5.111 npm ERR! make: Entering directory `/var/task/node_modules/node-gd/build'
#0 5.111 npm ERR!   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
#0 5.111 npm ERR! rm -f Release/obj.target/../node-addon-api/nothing.a Release/obj.target/../node-addon-api/nothing.a.ar-file-list; mkdir -p `dirname Release/obj.target/../node-addon-api/nothing.a`
#0 5.111 npm ERR! ar crs Release/obj.target/../node-addon-api/nothing.a @Release/obj.target/../node-addon-api/nothing.a.ar-file-list
#0 5.111 npm ERR!   COPY Release/nothing.a
#0 5.111 npm ERR!   CXX(target) Release/obj.target/node_gd/src/addon.o
#0 5.111 npm ERR! make: Leaving directory `/var/task/node_modules/node-gd/build'
#0 5.111 npm ERR! gyp info it worked if it ends with ok
#0 5.111 npm ERR! gyp info using [email protected]
#0 5.111 npm ERR! gyp info using [email protected] | linux | arm64
#0 5.111 npm ERR! gyp info find Python using Python version 3.7.16 found at "/usr/bin/python3"
#0 5.111 npm ERR! gyp http GET https://nodejs.org/download/release/v18.16.1/node-v18.16.1-headers.tar.gz
#0 5.111 npm ERR! gyp http 200 https://nodejs.org/download/release/v18.16.1/node-v18.16.1-headers.tar.gz
#0 5.111 npm ERR! gyp http GET https://nodejs.org/download/release/v18.16.1/SHASUMS256.txt
#0 5.111 npm ERR! gyp http 200 https://nodejs.org/download/release/v18.16.1/SHASUMS256.txt
#0 5.111 npm ERR! gyp info spawn /usr/bin/python3
#0 5.111 npm ERR! gyp info spawn args [
#0 5.111 npm ERR! gyp info spawn args   '/var/task/node_modules/node-gyp/gyp/gyp_main.py',
#0 5.111 npm ERR! gyp info spawn args   'binding.gyp',
#0 5.111 npm ERR! gyp info spawn args   '-f',
#0 5.111 npm ERR! gyp info spawn args   'make',
#0 5.111 npm ERR! gyp info spawn args   '-I',
#0 5.111 npm ERR! gyp info spawn args   '/var/task/node_modules/node-gd/build/config.gypi',
#0 5.111 npm ERR! gyp info spawn args   '-I',
#0 5.111 npm ERR! gyp info spawn args   '/var/task/node_modules/node-gyp/addon.gypi',
#0 5.111 npm ERR! gyp info spawn args   '-I',
#0 5.112 npm ERR! gyp info spawn args   '/root/.cache/node-gyp/18.16.1/include/node/common.gypi',
#0 5.112 npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
#0 5.112 npm ERR! gyp info spawn args   '-Dvisibility=default',
#0 5.112 npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/18.16.1',
#0 5.112 npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/var/task/node_modules/node-gyp',
#0 5.112 npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/18.16.1/<(target_arch)/node.lib',
#0 5.112 npm ERR! gyp info spawn args   '-Dmodule_root_dir=/var/task/node_modules/node-gd',
#0 5.112 npm ERR! gyp info spawn args   '-Dnode_engine=v8',
#0 5.112 npm ERR! gyp info spawn args   '--depth=.',
#0 5.112 npm ERR! gyp info spawn args   '--no-parallel',
#0 5.112 npm ERR! gyp info spawn args   '--generator-output',
#0 5.112 npm ERR! gyp info spawn args   'build',
#0 5.112 npm ERR! gyp info spawn args   '-Goutput_dir=.'
#0 5.112 npm ERR! gyp info spawn args ]
#0 5.112 npm ERR! gyp info spawn make
#0 5.112 npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build', '--jobs', 5 ]
#0 5.112 npm ERR! In file included from ../src/addon.cc:20:0:
#0 5.112 npm ERR! ../src/node_gd.cc:24:10: fatal error: gd_errors.h: No such file or directory
#0 5.112 npm ERR!  #include <gd_errors.h>
#0 5.112 npm ERR!           ^~~~~~~~~~~~~
#0 5.112 npm ERR! compilation terminated.
#0 5.112 npm ERR! make: *** [Release/obj.target/node_gd/src/addon.o] Error 1
#0 5.112 npm ERR! gyp ERR! build error 
#0 5.112 npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
#0 5.112 npm ERR! gyp ERR! stack     at ChildProcess.onExit (/var/task/node_modules/node-gyp/lib/build.js:203:23)
#0 5.112 npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
#0 5.112 npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
#0 5.112 npm ERR! gyp ERR! System Linux 5.15.49-linuxkit-pr
#0 5.112 npm ERR! gyp ERR! command "/var/lang/bin/node" "/var/task/node_modules/.bin/node-gyp" "rebuild" "-j" "max"
#0 5.112 npm ERR! gyp ERR! cwd /var/task/node_modules/node-gd
#0 5.112 npm ERR! gyp ERR! node -v v18.16.1
#0 5.112 npm ERR! gyp ERR! node-gyp -v v9.3.1
#0 5.112 npm ERR! gyp ERR! not ok

@y-a-v-a
Copy link
Owner

y-a-v-a commented Aug 21, 2023

Hi!
The error refers to a file from libgd, being https://github.com/libgd/libgd/blob/master/src/gd_errors.h
node-gd is a package that creates bindings in C++ between NodeJS and the library libgd. To be able to build these bindings, you need the source files of libgd.
node-gyp is a package that will search in configured places for these source files. My guess is that your system is missing the libgd files.
Dependening on the system you're working on, you will need to install libgd. See the README.md for further info.

Cheers,
Vincent

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