romgrk / node-gtk

GTK+ bindings for NodeJS (via GObject introspection)
MIT License
492 stars 41 forks source link

Npm or yarn installation error #324

Open xfxpositions opened 2 years ago

xfxpositions commented 2 years ago

Hi i want to install node gtk by npm but some giving error

npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /home/yusuf/node_modules/node-gtk
npm ERR! command failed
npm ERR! command sh -c if [ "$(uname)" = "Darwin" ] && [ "$(which brew)" != "" ]; then export PKG_CONFIG_PATH=$(brew --prefix libffi)/lib/pkgconfig; fi; node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/yusuf/node_modules/node-gtk/lib/binding/node-v102-linux-x64/node_gtk.node --module_name=node_gtk --module_path=/home/yusuf/node_modules/node-gtk/lib/binding/node-v102-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.9
npm ERR! node-pre-gyp info using node@17.8.0 | linux | x64
npm ERR! node-pre-gyp info check checked for "/home/yusuf/node_modules/node-gtk/lib/binding/node-v102-linux-x64/node_gtk.node" (not found)
npm ERR! node-pre-gyp http GET https://node-gtk-1.s3.amazonaws.com/node_gtk/v0.10.0/node_gtk-node-v102-linux-x64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://node-gtk-1.s3.amazonaws.com/node_gtk/v0.10.0/node_gtk-node-v102-linux-x64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for node-gtk@0.10.0 and node@17.8.0 (node-v102 ABI, glibc) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp WARN Hit error response status 403 Forbidden on https://node-gtk-1.s3.amazonaws.com/node_gtk/v0.10.0/node_gtk-node-v102-linux-x64.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@17.8.0 | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@17.8.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
npm ERR! gyp WARN EACCES current user ("yusuf") does not have permission to access the dev dir "/root/.cache/node-gyp/17.8.0"
npm ERR! gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/yusuf/node_modules/node-gtk/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/tmp/.node-gyp/17.8.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/tmp/.node-gyp/17.8.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/tmp/.node-gyp/17.8.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/yusuf/node_modules/node-gtk',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Package gobject-introspection-1.0 was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! Package 'gobject-introspection-1.0', required by 'virtual:world', not found
npm ERR! gyp: Call to 'pkg-config --cflags gobject-introspection-1.0 cairo' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.16.16-zen1-1-zen
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/yusuf/node_modules/node-gtk/lib/binding/node-v102-linux-x64/node_gtk.node" "--module_name=node_gtk" "--module_path=/home/yusuf/node_modules/node-gtk/lib/binding/node-v102-linux-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v102"
npm ERR! gyp ERR! cwd /home/yusuf/node_modules/node-gtk
npm ERR! gyp ERR! node -v v17.8.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/yusuf/node_modules/node-gtk/lib/binding/node-v102-linux-x64/node_gtk.node --module_name=node_gtk --module_path=/home/yusuf/node_modules/node-gtk/lib/binding/node-v102-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/yusuf/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1090:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Linux 5.16.16-zen1-1-zen
npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/home/yusuf/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/yusuf/node_modules/node-gtk
npm ERR! node-pre-gyp ERR! node -v v17.8.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-03-31T16_35_45_410Z-debug-0.log
wotzlaff commented 2 years ago

I think the build is failing because you are missing some required package. The error log states that Package gobject-introspection-1.0 was not found in the pkg-config search path.

Try to install the package using gobject-introspection. Alternatively, you could use node version 16 for which a prebuild version of node-gtk should be available.

@romgrk: Should we try to build for node 17?

xfxpositions commented 2 years ago

Yes! The problem has been solved but im using Arch Based Linux İs any way can i do it in windows laptop.

wotzlaff commented 2 years ago

Building node-gtk on Windows is still an open issue (#241). Actually, I do not expect it to be solved soon...

ten0s commented 2 years ago

Initial Windows build is done in PR https://github.com/romgrk/node-gtk/pull/327

xfxpositions commented 2 years ago

[4/4] Building fresh packages... [1/2] ⠂ esbuild error C:\Users\yusuf\node_modules\node-gtk: Command failed. Exit code: 1 Command: if [ "$(uname)" = "Darwin" ] && [ "$(which brew)" != "" ]; then export PKG_CONFIG_PATH=$(brew --prefix libffi)/lib/pkgconfig; fi; node-pre-gyp install --fallback-to-build Arguments: Directory: C:\Users\yusuf\node_modules\node-gtk Output: "$(uname)" was unexpected at this time. error on install by yarn

ten0s commented 2 years ago

Please try again.

  1. Update master

  2. Run:

$ ./windows/mingw_include_extra.sh
  1. Optionally run:
# if MSYS2 is NOT installed in C:/msys64 run:
$ export MINGW_WINDOWS_PATH=$(./windows/mingw_windows_path.sh)
  1. Run:
$ npx node-pre-gyp configure build --debug

See https://github.com/romgrk/node-gtk/blob/master/.github/workflows/main.yaml for detail