kisonecat / web2js

Convert TeX's pascal to javascript
Other
114 stars 16 forks source link

`node-kpathsea` Version 1.1.0 doesn't exist #8

Open phibr0 opened 2 years ago

phibr0 commented 2 years ago

node-kpathsea Version 1.1.0 doesn't exist on NPM, and even if I downgrade it (to the one available version 1.0.0), I cannot get it to properly install:

Console output
npm ERR! code 1
npm ERR! path C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR!   kpathsea.cc
npm ERR! C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea\src\node_kpathsea.h(4,10): fatal error C1083: Cannot open include file: 'kpathsea/kpathsea.h': No such file or directory [C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea\build\kpathsea.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.18.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.2 found at "C:\Program Files\Python39\python.exe"
npm ERR! gyp info find VS using VS2019 (16.10.31321.278) found at:
npm ERR! gyp info find VS "H:\Visual Studio"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Program Files\Python39\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\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   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\14.18.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=C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\14.18.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.18.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea',
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   'C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn H:\Visual Studio\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `H:\Visual Studio\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea     
npm ERR! gyp ERR! node -v v14.18.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2021-10-24T12_15_35_174Z-debug.log 
Complete Log
0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install'
0 verbose cli ]
1 info using npm@7.15.0
2 info using node@v14.18.1
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Users\user\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:C:\Users\user\Documents\Repositories\web2js\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\user\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Users\user\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 6ms
19 timing npm:load:configload Completed in 6ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 1ms
22 timing npm:load:cleanupLog Completed in 2ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 1ms
25 timing npm:load Completed in 11ms
26 timing config:load:flatten Completed in 2ms
27 timing arborist:ctor Completed in 0ms
28 timing arborist:ctor Completed in 1ms
29 timing arborist:ctor Completed in 0ms
30 timing arborist:ctor Completed in 0ms
31 timing idealTree:init Completed in 50ms
32 timing idealTree:userRequests Completed in 0ms
33 silly idealTree buildDeps
34 silly fetch manifest node-kpathsea@^1.0.0
35 http fetch GET 200 https://registry.npmjs.org/node-kpathsea 88ms
36 silly placeDep ROOT node-kpathsea@1.0.0 OK for: web2js@1.0.0 want: ^1.0.0
37 silly fetch manifest bindings@^1.3.0
38 silly fetch manifest nan@^2.8.0
39 http fetch GET 304 https://registry.npmjs.org/bindings 49ms (from cache)
40 http fetch GET 304 https://registry.npmjs.org/nan 77ms (from cache)
41 timing idealTree:#root Completed in 170ms
42 silly placeDep ROOT bindings@1.5.0 OK for: node-kpathsea@1.0.0 want: ^1.3.0
43 silly placeDep ROOT nan@2.15.0 OK for: node-kpathsea@1.0.0 want: ^2.8.0
44 silly fetch manifest file-uri-to-path@1.0.0
45 http fetch GET 304 https://registry.npmjs.org/file-uri-to-path 43ms (from cache)
46 timing idealTree:node_modules/node-kpathsea Completed in 45ms
47 silly placeDep ROOT file-uri-to-path@1.0.0 OK for: bindings@1.5.0 want: 1.0.0
48 timing idealTree:node_modules/bindings Completed in 0ms
49 timing idealTree:node_modules/file-uri-to-path Completed in 0ms
50 timing idealTree:node_modules/nan Completed in 1ms
51 timing idealTree:buildDeps Completed in 219ms
52 timing idealTree:fixDepFlags Completed in 0ms
53 timing idealTree Completed in 270ms
54 timing reify:loadTrees Completed in 271ms
55 timing reify:diffTrees Completed in 3ms
56 silly reify moves {}
57 timing reify:retireShallow Completed in 0ms
58 timing reify:createSparse Completed in 1ms
59 timing reify:loadBundles Completed in 0ms
60 silly audit bulk request {
60 silly audit   amdefine: [ '1.0.1' ],
60 silly audit   'ansi-styles': [ '3.2.1' ],
60 silly audit   'balanced-match': [ '1.0.2' ],
60 silly audit   binaryen: [ '89.0.0' ],
60 silly audit   'brace-expansion': [ '1.1.11' ],
60 silly audit   chalk: [ '2.4.2' ],
60 silly audit   cjson: [ '0.3.0' ],
60 silly audit   'color-convert': [ '1.9.3' ],
60 silly audit   'color-name': [ '1.1.3' ],
60 silly audit   colors: [ '1.4.0', '0.5.1' ],
60 silly audit   'concat-map': [ '0.0.1' ],
60 silly audit   diff: [ '5.0.0' ],
60 silly audit   'ebnf-parser': [ '0.1.10' ],
60 silly audit   'escape-string-regexp': [ '1.0.5' ],
60 silly audit   escodegen: [ '1.3.3' ],
60 silly audit   esprima: [ '1.1.1' ],
60 silly audit   estraverse: [ '1.5.1' ],
60 silly audit   esutils: [ '1.0.0' ],
60 silly audit   'flex-js': [ '1.0.5' ],
60 silly audit   'fs.realpath': [ '1.0.0' ],
60 silly audit   glob: [ '7.2.0' ],
60 silly audit   'has-flag': [ '3.0.0' ],
60 silly audit   inflight: [ '1.0.6' ],
60 silly audit   inherits: [ '2.0.4' ],
60 silly audit   jison: [ '0.4.18' ],
60 silly audit   'jison-lex': [ '0.3.4' ],
60 silly audit   jsonlint: [ '1.6.0' ],
60 silly audit   JSONSelect: [ '0.4.0' ],
60 silly audit   JSV: [ '4.0.2' ],
60 silly audit   'lex-parser': [ '0.1.4' ],
60 silly audit   'log-symbols': [ '2.2.0' ],
60 silly audit   minimatch: [ '3.0.4' ],
60 silly audit   nomnom: [ '1.5.2' ],
60 silly audit   once: [ '1.4.0' ],
60 silly audit   'path-is-absolute': [ '1.0.1' ],
60 silly audit   pegjs: [ '0.10.0' ],
60 silly audit   'source-map': [ '0.1.43' ],
60 silly audit   'supports-color': [ '5.5.0' ],
60 silly audit   underscore: [ '1.1.7' ],
60 silly audit   wrappy: [ '1.0.2' ],
60 silly audit   'node-kpathsea': [ '1.0.0' ],
60 silly audit   bindings: [ '1.5.0' ],
60 silly audit   nan: [ '2.15.0' ],
60 silly audit   'file-uri-to-path': [ '1.0.0' ]
60 silly audit }
61 timing reifyNode:node_modules/bindings Completed in 44ms
62 timing reifyNode:node_modules/node-kpathsea Completed in 48ms
63 timing reifyNode:node_modules/file-uri-to-path Completed in 53ms
64 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 352ms
65 timing auditReport:getReport Completed in 354ms
66 silly audit report {}
67 timing auditReport:init Completed in 0ms
68 timing reify:audit Completed in 355ms
69 timing reifyNode:node_modules/nan Completed in 540ms
70 timing reify:unpack Completed in 540ms
71 timing reify:unretire Completed in 1ms
72 timing build:queue Completed in 1ms
73 info run node-kpathsea@1.0.0 install node_modules/node-kpathsea node-gyp rebuild
74 info run node-kpathsea@1.0.0 install { code: 1, signal: null }
75 timing reify:rollback:createSparse Completed in 17ms
76 timing reify:rollback:retireShallow Completed in 0ms
77 timing command:install Completed in 14723ms
78 verbose stack Error: command failed
78 verbose stack     at ChildProcess. (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
78 verbose stack     at ChildProcess.emit (events.js:400:28)
78 verbose stack     at maybeClose (internal/child_process.js:1058:16)
78 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
79 verbose pkgid node-kpathsea@1.0.0
80 verbose cwd C:\Users\user\Documents\Repositories\web2js
81 verbose Windows_NT 10.0.22000
82 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
83 verbose node v14.18.1
84 verbose npm  v7.15.0
85 error code 1
86 error path C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea
87 error command failed
88 error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
89 error Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
89 error   kpathsea.cc
89 error C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea\src\node_kpathsea.h(4,10): fatal error C1083: Cannot open include file: 'kpathsea/kpathsea.h': No such file or directory [C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea\build\kpathsea.vcxproj]
90 error gyp info it worked if it ends with ok
90 error gyp info using node-gyp@7.1.2
90 error gyp info using node@14.18.1 | win32 | x64
90 error gyp info find Python using Python version 3.9.2 found at "C:\Program Files\Python39\python.exe"
90 error gyp info find VS using VS2019 (16.10.31321.278) found at:
90 error gyp info find VS "H:\Visual Studio"
90 error gyp info find VS run with --verbose for detailed information
90 error gyp info spawn C:\Program Files\Python39\python.exe
90 error gyp info spawn args [
90 error gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
90 error gyp info spawn args   'binding.gyp',
90 error gyp info spawn args   '-f',
90 error gyp info spawn args   'msvs',
90 error gyp info spawn args   '-I',
90 error gyp info spawn args   'C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea\\build\\config.gypi',
90 error gyp info spawn args   '-I',
90 error gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
90 error gyp info spawn args   '-I',
90 error gyp info spawn args   'C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\14.18.1\\include\\node\\common.gypi',
90 error gyp info spawn args   '-Dlibrary=shared_library',
90 error gyp info spawn args   '-Dvisibility=default',
90 error gyp info spawn args   '-Dnode_root_dir=C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\14.18.1',
90 error gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
90 error gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.18.1\\\\<(target_arch)\\\\node.lib',
90 error gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea',
90 error gyp info spawn args   '-Dnode_engine=v8',
90 error gyp info spawn args   '--depth=.',
90 error gyp info spawn args   '--no-parallel',
90 error gyp info spawn args   '--generator-output',
90 error gyp info spawn args   'C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea\\build',
90 error gyp info spawn args   '-Goutput_dir=.'
90 error gyp info spawn args ]
90 error gyp info spawn H:\Visual Studio\MSBuild\Current\Bin\MSBuild.exe
90 error gyp info spawn args [
90 error gyp info spawn args   'build/binding.sln',
90 error gyp info spawn args   '/clp:Verbosity=minimal',
90 error gyp info spawn args   '/nologo',
90 error gyp info spawn args   '/p:Configuration=Release;Platform=x64'
90 error gyp info spawn args ]
90 error gyp ERR! build error
90 error gyp ERR! stack Error: `H:\Visual Studio\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
90 error gyp ERR! stack     at ChildProcess.onExit (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
90 error gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
90 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
90 error gyp ERR! System Windows_NT 10.0.22000
90 error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
90 error gyp ERR! cwd C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea
90 error gyp ERR! node -v v14.18.1
90 error gyp ERR! node-gyp -v v7.1.2
90 error gyp ERR! not ok
91 verbose exit 1

Another thing, is there anything (legal or something?) stopping you from distributing the core.dump files etc.? If not, why not create Releases here on GitHub with the Files attached. This would really help others use your Project!

3ur3ka commented 2 years ago

As a workaround I reverted the commit where node-kpathsea gets implemented. That allows the build to proceed, but then I get stuck with: ! Package pgf Error: Driver file pgfsys-ximera.def not found..... Anyone any ideas?

kisonecat commented 2 years ago

https://github.com/XimeraProject/ximeraLatex/blob/development/src/pgfsys.dtx is a source for that file. Maybe it should be in this repo.

The node-kpathsea dependency is a different issue: I have https://github.com/kisonecat/node-kpathsea which has the newer version, which is compatible with more recent nodejs (e.g., v14.17.5 on my machine).

I really need to package this all better (hopefully once the semester ends!). I see a fair number of people are using TikZJax so there's really a need to make this go.

3ur3ka commented 2 years ago

Thanks Jim, that's great :-) Great work on this, it's really awesome and useful for my website...

3ur3ka commented 2 years ago

Ok so I've updated all the libraries and now I can build the core.dump and tex.wasm. Which is great news for me as the encoding problems and missing symbols are now fixed. I actually want to use them with TikZJax (which I've also updated) but when I build with the ximera.cls doc class it works but the diagram has paper size that is not appropriate, and when I try building with the standalone.cls document class it complains about a missing \begin{document}. It does continue and kind of works but it sets the papersize to zero. Can I ask did you modify the original standalone.cls, any ideas how I might fix it?! Thanks again.

phibr0 commented 2 years ago

Another thing, is there anything (legal or something?) stopping you from distributing the core.dump files etc.? If not, why not create Releases here on GitHub with the Files attached. This would really help others use your Project!

Anything about that, @kisonecat? It is really impressive what this can do, and I would like to use it, unfortunately I cannot get it to compile on my machine..

3ur3ka commented 2 years ago

Hi @phibr0, I've made my repos public, my code needs tidying up and I prob should have forked the repos but nvmd.. hope this compiles for you. If it doesn't work, you could pull the binaries from my work in progress site here (it takes a little while for the pic to render, but I think it's ok...) https://edushare.io/student/courses/a-level-maths-guide/ Repos are here: https://github.com/3ur3ka/web2js https://github.com/3ur3ka/tikzjax

My tikzjax code to get the bounding box for the svg is hard coded and horrible, but seems to do the job for what I want. The memory footprint for the decompressed binaries is quite large (163mb), it works on the iPhone 13 but not on my poor phone. We might be able to reduce the size of the core.dump by using an optimum number of pages? Anyways desktop seems ok on safari and chrome.

nosuke23 commented 2 years ago

To solve node-kpathsea, You have to change package.json to get from github.

- "node-kpathsea": "^1.1.0"
+ "node-kpathsea": "kisonecat/node-kpathsea"