openzim / mwoffliner

Mediawiki scraper: all your wiki articles in one highly compressed ZIM file
https://www.npmjs.com/package/mwoffliner
GNU General Public License v3.0
271 stars 72 forks source link

Installation Error Development Environment for Fedora 34 #1498

Open manavdesai27 opened 3 years ago

manavdesai27 commented 3 years ago

I have been trying to install the development environment in my Fedora 34.

It gives this error: Failed at the jpegoptim-bin@6.0.0 postinstall script.

The following:

error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory

Now the issue is Fedora doesn't have that library, instead it uses something called libjpeg-turbo-devel.

Kindly resolve this issue.

manavdesai27 commented 3 years ago

I have been able to resolve jpegoptim-bin error by building it from source and adding libjpeg.so.8 library in my ldconfig file.

I am getting another error now:

../src/module.cc:2:10: fatal error: napi.h: No such file or directory

kelson42 commented 3 years ago

Please share the full mwoffliner installation and run log.

manavdesai27 commented 3 years ago

npm WARN prepare removing existing node_modules/ before installation

sharp@0.26.2 install /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /root/.npm/_cacache/_libvips/libvips-8.10.0-linux-x64.tar.br

unix-dgram@2.0.4 install /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/unix-dgram node-gyp rebuild

make: Entering directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/unix-dgram/build' CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o In file included from ../src/unix_dgram.cc:5: ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker)’: ../../nan/nan.h:2294:7: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type] 2294 | , reinterpret_cast(AsyncExecuteComplete) | ^~~~~~~~~~~~ In file included from ../../nan/nan.h:56, from ../src/unix_dgram.cc:5: ../src/unix_dgram.cc: At global scope: /root/.cache/node-gyp/14.16.1/include/node/node.h:758:7: warning: cast between incompatible function types from ‘void ()(v8::Local)’ to ‘node::addon_register_func’ {aka ‘void ()(v8::Local, v8::Local, void)’} [-Wcast-function-type] 758 | (node::addon_register_func) (regfunc), \ | ^~~~~~~~~ /root/.cache/node-gyp/14.16.1/include/node/node.h:792:3: note: in expansion of macro ‘NODE_MODULE_X’ 792 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) | ^~~~~ ../src/unix_dgram.cc:404:1: note: in expansion of macro ‘NODE_MODULE’ 404 | NODE_MODULE(unix_dgram, Initialize) | ^~~ SOLINK_MODULE(target) Release/obj.target/unix_dgram.node COPY Release/unix_dgram.node make: Leaving directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/unix-dgram/build'

heapdump@0.3.15 install /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/heapdump node-gyp rebuild

make: Entering directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/heapdump/build' CXX(target) Release/obj.target/addon/src/heapdump.o In file included from ../src/heapdump.cc:17: ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker)’: ../../nan/nan.h:2294:7: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type] 2294 | , reinterpret_cast(AsyncExecuteComplete) | ^~~~~~~~~~~~ In file included from ../src/heapdump.cc:15: ../src/heapdump.cc: At global scope: /root/.cache/node-gyp/14.16.1/include/node/node.h:758:7: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Local, v8::Local, void*)’} [-Wcast-function-type] 758 | (node::addon_register_func) (regfunc), \ | ^~~~~~~~~ /root/.cache/node-gyp/14.16.1/include/node/node.h:792:3: note: in expansion of macro ‘NODE_MODULE_X’ 792 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) | ^~~~~ ../src/heapdump.cc:136:1: note: in expansion of macro ‘NODE_MODULE’ 136 | NODE_MODULE(addon, Initialize) | ^~~ SOLINK_MODULE(target) Release/obj.target/addon.node COPY Release/addon.node make: Leaving directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/heapdump/build'

gc-stats@1.4.0 install /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/gc-stats node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Tried to download(403): https://node-binaries.s3.amazonaws.com/gcstats/v1.4.0/Release/node-v83-linux-x64.tar.gz node-pre-gyp WARN Pre-built binaries not found for gc-stats@1.4.0 and node@14.16.1 (node-v83 ABI, glibc) (falling back to source compile with node-gyp) make: Entering directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/gc-stats/build' CXX(target) Release/obj.target/gcstats/src/gcstats.o In file included from ../src/gcstats.cc:1: ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker)’: ../../nan/nan.h:2294:7: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type] 2294 | , reinterpret_cast(AsyncExecuteComplete) | ^~~~~~~~~~~~ In file included from ../../nan/nan.h:56, from ../src/gcstats.cc:1: ../src/gcstats.cc: At global scope: /root/.cache/node-gyp/14.16.1/include/node/node.h:758:7: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Local, v8::Local, void*)’} [-Wcast-function-type] 758 | (node::addon_register_func) (regfunc), \ | ^~~~~~~~~ /root/.cache/node-gyp/14.16.1/include/node/node.h:792:3: note: in expansion of macro ‘NODE_MODULE_X’ 792 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) | ^~~~~ ../src/gcstats.cc:226:1: note: in expansion of macro ‘NODE_MODULE’ 226 | NODE_MODULE(gcstats, init) | ^~~ SOLINK_MODULE(target) Release/obj.target/gcstats.node COPY Release/gcstats.node COPY /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/gc-stats/build/gcstats/v1.4.0/Release/node-v83-linux-x64/gcstats.node TOUCH Release/obj.target/action_after_build.stamp make: Leaving directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/gc-stats/build'

dtrace-provider@0.8.8 install /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/dtrace-provider node-gyp rebuild || node suppress-error.js

make: Entering directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/dtrace-provider/build' TOUCH Release/obj.target/DTraceProviderStub.stamp make: Leaving directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/dtrace-provider/build'

core-js@2.6.12 postinstall /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

cwebp-bin@5.1.0 postinstall /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/cwebp-bin node lib/install.js

✔ cwebp pre-build test passed successfully

pngquant-bin@6.0.0 postinstall /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/pngquant-bin node lib/install.js

✔ pngquant pre-build test passed successfully

optipng-bin@7.0.0 postinstall /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/optipng-bin node lib/install.js

✔ optipng pre-build test passed successfully

jpegtran-bin@5.0.1 postinstall /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/jpegtran-bin node lib/install.js

✔ jpegtran pre-build test passed successfully

jpegoptim-bin@6.0.0 postinstall /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/jpegoptim-bin node lib/install.js

✔ jpegoptim pre-build test passed successfully

gifsicle@5.1.0 postinstall /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/gifsicle node lib/install.js

⚠ Response code 404 (Not Found) ⚠ gifsicle pre-build test failed ℹ compiling from source ✔ gifsicle built successfully

advpng-bin@5.0.0 postinstall /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/advpng-bin node lib/install.js

✔ advpng pre-build test passed successfully

@openzim/libzim@2.4.4 install /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim npm run download && node-gyp rebuild -v && npm run bundle

@openzim/libzim@2.4.4 download /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim node ./download-libzim.js

Downloading Libzim from: http://download.openzim.org/release/libzim/libzim_linux-x86_64-6.3.2.tar.gz Running Extract: [tar --strip-components 1 -xf ./download/libzim_linux-x86_64-6.3.2.tar.gz -C ./download] Successfully downloaded and extracted file gyp info it worked if it ends with ok gyp verb cli [ gyp verb cli '/usr/local/nvm/versions/node/v14.16.1/bin/node', gyp verb cli '/usr/local/nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'rebuild', gyp verb cli '-v' gyp verb cli ] gyp info using node-gyp@5.1.0 gyp info using node@14.16.1 | linux | x64 gyp verb command rebuild [] gyp verb command clean [] gyp verb clean removing "build" directory gyp verb command configure [] gyp verb find Python Python is not set from command line or npm configuration gyp verb find Python Python is not set from environment variable PYTHON gyp verb find Python checking if "python" can be used gyp verb find Python - executing "python" to get executable path gyp verb find Python - executable path is "/usr/bin/python" gyp verb find Python - executing "/usr/bin/python" to get version gyp verb find Python - version is "3.9.5" gyp info find Python using Python version 3.9.5 found at "/usr/bin/python" gyp verb get node dir no --target version specified, falling back to host node version: 14.16.1 gyp verb command install [ '14.16.1' ] gyp verb install input version string "14.16.1" gyp verb install installing version: 14.16.1 gyp verb install --ensure was passed, so won't reinstall if already installed gyp verb install version is already installed, need to check "installVersion" gyp verb got "installVersion" 9 gyp verb needs "installVersion" 9 gyp verb install version is good gyp verb get node dir target node version installed: 14.16.1 gyp verb build dir attempting to create "build" dir: /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/build gyp verb build dir "build" dir needed to be created? /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/build gyp verb build/config.gypi creating config file gyp verb build/config.gypi writing out config file: /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/build/config.gypi gyp verb config.gypi checking for gypi file: /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/config.gypi gyp verb common.gypi checking for gypi file: /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/common.gypi gyp verb gyp gyp format was not specified; forcing "make" gyp info spawn /usr/bin/python gyp info spawn args [ gyp info spawn args '/usr/local/nvm/versions/node/v14.16.1/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 '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/local/nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/root/.cache/node-gyp/14.16.1/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/14.16.1', gyp info spawn args '-Dnode_gyp_dir=/usr/local/nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/14.16.1/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim', 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 verb command build [] gyp verb build type Release gyp verb architecture x64 gyp verb node dev dir /root/.cache/node-gyp/14.16.1 gyp verb which succeeded for make /usr/bin/make gyp info spawn make gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/build' g++ '-DNODE_GYP_MODULE_NAME=zim_binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_CPP_EXCEPTIONS' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/14.16.1/include/node -I/root/.cache/node-gyp/14.16.1/src -I/root/.cache/node-gyp/14.16.1/deps/openssl/config -I/root/.cache/node-gyp/14.16.1/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.16.1/deps/uv/include -I/root/.cache/node-gyp/14.16.1/deps/zlib -I/root/.cache/node-gyp/14.16.1/deps/v8/include -I/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/node-addon-api -I/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/download/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++1y -std=c++17 -fexceptions -MMD -MF ./Release/.deps/Release/obj.target/zim_binding/src/module.o.d.raw -c -o Release/obj.target/zim_binding/src/module.o ../src/module.cc ../src/module.cc:2:10: fatal error: napi.h: No such file or directory 2 | #include | ^~~~ compilation terminated. make: *** [zim_binding.target.mk:120: Release/obj.target/zim_binding/src/module.o] Error 1 make: Leaving directory '/home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) gyp ERR! System Linux 5.12.7-300.fc34.x86_64 gyp ERR! command "/usr/local/nvm/versions/node/v14.16.1/bin/node" "/usr/local/nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "-v" gyp ERR! cwd /home/manavdesai/Music/Gitub Repos/mwoffliner/node_modules/@openzim/libzim gyp ERR! node -v v14.16.1 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @openzim/libzim@2.4.4 install: npm run download && node-gyp rebuild -v && npm run bundle npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @openzim/libzim@2.4.4 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-07-17T07_06_40_255Z-debug.log

kelson42 commented 3 years ago

Your log does not include the command you run unfortunately.

kelson42 commented 3 years ago

Napi.h is part of Node.js looks like... so, nothing we can really do here to help you.

manavdesai27 commented 3 years ago

Could you at least tell me, what might be causing this error? Can you tell me in which file it is giving this error?

kelson42 commented 3 years ago

Compilation of native code binding fails because napi.h mandatory header is not there. Why it is not there is a mystery, it shoukd be delivered by your nodejs package, make a search on this specific file in fedora repository to find in which package it is... and i guess this package is simply not installed.

manavdesai27 commented 3 years ago

Screenshot from 2021-07-17 14-19-45 As you can see napi.h is already available.

manavdesai27 commented 3 years ago

I think there is a PATH problem:

Screenshot from 2021-07-17 14-32-44

kelson42 commented 3 years ago

@mgautierfr Do you fail to install mwoffliner as well on your Fedroa?

manavdesai27 commented 3 years ago

I have successfully installed the development environment on Fedora. I had a folder named Github Repos. I renamed it to Github_Repos and to my surprise it worked.

Thanks, @kelson42 for the help.

kelson42 commented 3 years ago

Strange... looks like a bug then. Will keep ticket open and try to reproduce.

manavdesai27 commented 3 years ago

I think it must be a problem with Fedora. It might not be converting space to _ like other Linux distros

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.