Ajaxy / telegram-tt

Telegram Web A, GPL v3
https://web.telegram.org/a
GNU General Public License v3.0
2.38k stars 518 forks source link

Error on npm install #196

Closed abdulbadii closed 1 year ago

abdulbadii commented 2 years ago

Tried do npm insall after first step instruction, but stumbled

there's warn output before that npm version required is far lower than the current installed one

(##################) ⠴ reify:emoji-data-ios: timing reifyNode:node_modules/eslint-plugin-teactn Complete
Comnpm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/budi/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm ERR! npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm ERR! npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm ERR! 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 ERR! npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c -- node-pre-gyp install --fallback-to-build
npm ERR! npm ERR! make: Entering directory '/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build'
npm ERR! npm ERR!   SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
npm ERR! npm ERR!   COPY Release/canvas-postbuild.node
npm ERR! npm ERR!   CXX(target) Release/obj.target/canvas/src/backend/Backend.o
npm ERR! npm ERR! make: Leaving directory '/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build'
npm ERR! npm ERR! Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v111' (1)
npm ERR! npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! npm ERR! node-pre-gyp info using node-pre-gyp@1.0.8
npm ERR! npm ERR! node-pre-gyp info using node@19.0.1 | linux | x64
npm ERR! npm ERR! node-pre-gyp info check checked for "/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build/Release/canvas.node" (not found)
npm ERR! npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v111-linux-glibc-x64.tar.gz
npm ERR! npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v111-linux-glibc-x64.tar.gz 
npm ERR! npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.9.0 and node@19.0.1 (node-v111 ABI, glibc) (falling back to source compile with node-gyp) 
npm ERR! npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v111-linux-glibc-x64.tar.gz 
npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp info using node-gyp@9.3.0
npm ERR! npm ERR! gyp info using node@19.0.1 | linux | x64
npm ERR! npm ERR! gyp info ok 
npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp info using node-gyp@9.3.0
npm ERR! npm ERR! gyp info using node@19.0.1 | linux | x64
npm ERR! npm ERR! gyp info find Python using Python version 3.10.7 found at "/usr/bin/python3"
npm ERR! npm ERR! gyp http GET https://nodejs.org/download/release/v19.0.1/node-v19.0.1-headers.tar.gz
npm ERR! npm ERR! gyp http 200 https://nodejs.org/download/release/v19.0.1/node-v19.0.1-headers.tar.gz
npm ERR! npm ERR! gyp http GET https://nodejs.org/download/release/v19.0.1/SHASUMS256.txt
npm ERR! npm ERR! gyp http 200 https://nodejs.org/download/release/v19.0.1/SHASUMS256.txt
npm ERR! npm ERR! gyp info spawn /usr/bin/python3
npm ERR! npm ERR! gyp info spawn args [
npm ERR! npm ERR! gyp info spawn args   '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! npm ERR! gyp info spawn args   '-f',
npm ERR! npm ERR! gyp info spawn args   'make',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build/config.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/home/budi/.cache/node-gyp/19.0.1/include/node/common.gypi',
npm ERR! npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/budi/.cache/node-gyp/19.0.1',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/budi/.cache/node-gyp/19.0.1/<(target_arch)/node.lib',
npm ERR! npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! npm ERR! gyp info spawn args   '--depth=.',
npm ERR! npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! npm ERR! gyp info spawn args   '--generator-output',
npm ERR! npm ERR! gyp info spawn args   'build',
npm ERR! npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! npm ERR! gyp info spawn args ]
npm ERR! npm ERR! gyp info ok 
npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp info using node-gyp@9.3.0
npm ERR! npm ERR! gyp info using node@19.0.1 | linux | x64
npm ERR! npm ERR! gyp info spawn make
npm ERR! npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! npm ERR! In file included from ../../nan/nan.h:178,
npm ERR! npm ERR!                  from ../src/backend/Backend.h:6,
npm ERR! npm ERR!                  from ../src/backend/Backend.cc:1:
npm ERR! npm ERR! ../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
npm ERR! npm ERR!    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR! npm ERR!       |                       ^~~~~~~~~~~~~~~~~
npm ERR! npm ERR! ../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
npm ERR! npm ERR!    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR! npm ERR!       |                                        ^
npm ERR! npm ERR! ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’:
npm ERR! npm ERR! ../../nan/nan.h:2544: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&, Nan::imp::Sig&)’
npm ERR! npm ERR!  2544 |   tpl->SetAccessor(
npm ERR! npm ERR!       |   ~~~~~~~~~~~~~~~~^
npm ERR! npm ERR!  2545 |       name
npm ERR! npm ERR!       |       ~~~~         
npm ERR! npm ERR!  2546 |     , getter_
npm ERR! npm ERR!       |     ~~~~~~~~~      
npm ERR! npm ERR!  2547 |     , setter_
npm ERR! npm ERR!       |     ~~~~~~~~~      
npm ERR! npm ERR!  2548 |     , obj
npm ERR! npm ERR!       |     ~~~~~          
npm ERR! npm ERR!  2549 |     , settings
npm ERR! npm ERR!       |     ~~~~~~~~~~     
npm ERR! npm ERR!  2550 |     , attribute
npm ERR! npm ERR!       |     ~~~~~~~~~~~    
npm ERR! npm ERR!  2551 |     , signature);
npm ERR! npm ERR!       |     ~~~~~~~~~~~~   
npm ERR! npm ERR! In file included from /home/budi/.cache/node-gyp/19.0.1/include/node/v8-function.h:15,
npm ERR! npm ERR!                  from /home/budi/.cache/node-gyp/19.0.1/include/node/v8.h:33,
npm ERR! npm ERR!                  from /home/budi/.cache/node-gyp/19.0.1/include/node/node.h:73,
npm ERR! npm ERR!                  from ../../nan/nan.h:58:
npm ERR! npm ERR! /home/budi/.cache/node-gyp/19.0.1/include/node/v8-template.h:807:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm ERR! npm ERR!   807 |   void SetAccessor(
npm ERR! npm ERR!       |        ^~~~~~~~~~~
npm ERR! npm ERR! /home/budi/.cache/node-gyp/19.0.1/include/node/v8-template.h:812:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
npm ERR! npm ERR!   812 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR! npm ERR!       |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! npm ERR! /home/budi/.cache/node-gyp/19.0.1/include/node/v8-template.h:814:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm ERR! npm ERR!   814 |   void SetAccessor(
npm ERR! npm ERR!       |        ^~~~~~~~~~~
npm ERR! npm ERR! /home/budi/.cache/node-gyp/19.0.1/include/node/v8-template.h:819:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
npm ERR! npm ERR!   819 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR! npm ERR!       |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! npm ERR! make: *** [canvas.target.mk:164: Release/obj.target/canvas/src/backend/Backend.o] Error 1
npm ERR! npm ERR! gyp ERR! build error 
npm ERR! npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! npm ERR! gyp ERR! System Linux 5.18.6-lqx1-1-lqx
npm ERR! npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v111"
npm ERR! npm ERR! gyp ERR! cwd /home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas
npm ERR! npm ERR! gyp ERR! node -v v19.0.1
npm ERR! npm ERR! gyp ERR! node-gyp -v v9.3.0
npm ERR! npm ERR! gyp ERR! not ok 
npm ERR! npm ERR! node-pre-gyp ERR! build error 
npm ERR! npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v111' (1)
npm ERR! npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
npm ERR! npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm ERR! npm ERR! node-pre-gyp ERR! System Linux 5.18.6-lqx1-1-lqx
npm ERR! npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! npm ERR! node-pre-gyp ERR! cwd /home/budi/.npm/_cacache/tmp/git-clonemBSp0s/node_modules/canvas
npm ERR! npm ERR! node-pre-gyp ERR! node -v v19.0.1
npm ERR! npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.8
npm ERR! npm ERR! node-pre-gyp ERR! not ok
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /home/budi/.npm/_logs/2022-11-17T00_03_46_588Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/budi/.npm/_logs/2022-11-17T00_03_18_338Z-debug-0.log

Please help guide, clarify till hopefully solve it out !

mariusiscoding commented 2 years ago

Seems like you have the same issue than I. Check the other issue thread. Make sure you use node with exactly version 16.13 and a proper npm version.

abdulbadii commented 2 years ago

is not donward compatible?

zubiden commented 1 year ago

Seems that npm tries to install unnecessary devDependencies from one of the git dependencies, and fails while running prepare script. Still, I can’t find any workaround to prevent this.

ZhukovMv commented 1 year ago

i resolved this by installing the required dependencies for node-canvas from Homebrew: https://github.com/Automattic/node-canvas/wiki/Installation%3A-Mac-OS-X#homebrew

zubiden commented 1 year ago

Seems to be fixed now