artisticat1 / obsidian-tikzjax

Render LaTeX and TikZ diagrams in your notes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

installation issues (web2js but relevant to instructions here)

scks1 opened this issue · comments

commented

Technically, this is an issue with web2js, but it's important enough that I feel I should mention it here as it may help make your installation instructions clearer, which would benefit any Obsidian users who are trying to use LaTeX. I'm currently trying to set up the version of this plugin that allows me to add my own LaTeX packages. I cloned the ww-modifications branch of web2js, and attempted to npm install, but I was stopped in my tracks by the following error message:

scks@badcalculator ~/web2js (master)> npm install node-kpathsea
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.
npm 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/scks/.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! > node-kpathsea@1.1.0 install
npm ERR! > node-gyp rebuild
npm ERR! 
npm ERR! make: Entering directory '/home/scks/.npm/_cacache/tmp/git-clonef78ttp/build'
npm ERR!   CXX(target) Release/obj.target/kpathsea/src/kpathsea.o
npm ERR! make: Leaving directory '/home/scks/.npm/_cacache/tmp/git-clonef78ttp/build'
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN old lockfile 
npm ERR! npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm ERR! npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm ERR! npm WARN old lockfile 
npm ERR! npm WARN old lockfile This is a one-time fix-up, please be patient...
npm ERR! npm WARN old lockfile 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@19.8.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/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/scks/.npm/_cacache/tmp/git-clonef78ttp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/scks/.cache/node-gyp/19.8.1/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=/home/scks/.cache/node-gyp/19.8.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/scks/.cache/node-gyp/19.8.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/scks/.npm/_cacache/tmp/git-clonef78ttp',
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! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/kpathsea.cc:1:
npm ERR! ../src/node_kpathsea.h:4:10: fatal error: kpathsea/kpathsea.h: No such file or directory
npm ERR!     4 | #include <kpathsea/kpathsea.h>
npm ERR!       |          ^~~~~~~~~~~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [kpathsea.target.mk:113: Release/obj.target/kpathsea/src/kpathsea.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:512:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 5.15.0-67-generic
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/scks/.npm/_cacache/tmp/git-clonef78ttp
npm ERR! gyp ERR! node -v v19.8.1
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok 
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /home/scks/.npm/_cacache/tmp/git-clonef78ttp
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node-gyp rebuild
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /home/scks/.npm/_logs/2023-03-15T22_07_33_046Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/scks/.npm/_logs/2023-03-15T22_07_30_568Z-debug-0.log

The error is the same whether I enter this command or 'npm install' in the same web2js folder. My version of TeX includes kpathsea, so I don't understand what is going wrong. This message comes after I updated package.json to pull the appropriate version of node-kpathsea from Github. I'm at a loss for what to do at this point, since I am not experienced with node at all, so I would greatly appreciate some help. I apologize if there is an issue with asking about a dependency, but again, I think it would be useful if information about this could appear in the README and I wasn't sure whether it was appropriate to raise this issue on the web2js project.

Even though you have kpathsea, it doesn't come with the source header files (kpathsea/kpathsea.h) by default. I believe installing libkpathsea-dev will resolve your issue:

apt install -y libkpathsea-dev

You may be interested in my fork of tikzjax, where I've created a reproducible Docker container that resolves many of the build issues with the current version.