I am using Node version 12.19.0 and NPM version 6.14.8 on windows. I tried to install latest version and got 0.19.7 and did not face any issue in installation.
E:\SS\Service>npm install libxmljs
> libxmljs@0.19.7 install E:\SS\Service\node_modules\libxmljs
> node-pre-gyp install --fallback-to-build --loglevel http
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp http GET https://github.com/libxmljs/libxmljs/releases/download/v0.19.7/node-v72-win32-x64.tar.gz
node-pre-gyp http 404 https://github.com/libxmljs/libxmljs/releases/download/v0.19.7/node-v72-win32-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/libxmljs/libxmljs/releases/download/v0.19.7/node-
v72-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for libxmljs@0.19.7 and node@12.19.0 (node-v72 ABI, unknown) (f
alling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/libxmljs/libxmljs/releases/download/v
0.19.7/node-v72-win32-x64.tar.gz
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
libxmljs.cc
xml_attribute.cc
xml_document.cc
xml_element.cc
xml_comment.cc
xml_namespace.cc
xml_node.cc
xml_sax_parser.cc
xml_syntax_error.cc
E:\SS\Servicenode_modules\libxmljs\src\xml_sax_parser.cc(130): warning C4996: 'Nan::MakeCallback': was declared deprecated [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
E:\SS\Servicenode_modules\nan\nan.h(1026): note: see declaration of 'Nan::Make Callback'xml_text.cc
xml_pi.cc
xml_xpath_context.cc
win_delay_load_hook.cc
buf.c
catalog.c
chvalid.c
dict.c
E:\SS\Servicenode_modules\libxmljs\vendor\libxml\catalog.c(984): warning C4013:'open' undefined; assuming extern returning int [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
E:\SS\Servicenode_modules\libxmljs\vendor\libxml\catalog.c(1003): warning C4013: 'close' undefined; assuming extern returning int [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
E:\SS\Servicenode_modules\libxmljs\vendor\libxml\catalog.c(1010): warning C4013: 'read' undefined; assuming extern returning int [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
encoding.c
entities.c
error.c
globals.c
hash.c
HTMLparser.c
HTMLtree.c
legacy.c
list.c
parser.c
parserInternals.c
pattern.c
relaxng.c
SAX2.c
SAX.c
tree.c
threads.c
uri.c
valid.c
xinclude.c
xlink.c
xmlIO.c
xmlmemory.c
xmlmodule.c
xmlreader.c
xmlregexp.c
E:\SS\Servicenode_modules\libxmljs\vendor\libxml\xmlio.c(733): warning C4013: 'read' undefined; assuming extern returning int [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xmlsave.c
E:\SS\Servicenode_modules\libxmljs\vendor\libxml\xmlio.c(754): warning C4013: 'write' undefined; assuming extern returning int [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
E:\SS\Servicenode_modules\libxmljs\vendor\libxml\xmlio.c(772): warning C4013: 'close' undefined; assuming extern returning int [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
E:\SS\Servicenode_modules\libxmljs\vendor\libxml\xmlio.c(3743): warning C4013: 'getcwd' undefined; assuming extern returning int [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
E:\SS\Servicenode_modules\libxmljs\vendor\libxml\xmlio.c(3743): warning C4047: '!=': 'int' differs in levels of indirection from 'void *' [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xmlschemas.c
xmlschemastypes.c
xmlstring.c
xmlunicode.c
xmlwriter.c
xpath.c
xpointer.c
Creating library E:\SS\Service\node_modules\libxmljs\build\Release\xmljs.lib
and object E:\SS\Service\node_modules\libxmljs\build\Release\xmljs.exp
libxmljs.obj : warning LNK4049: locally defined symbol xmlParserVersion imported [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xml_node.obj : warning LNK4049: locally defined symbol xmlFree imported [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xml_text.obj : warning LNK4049: locally defined symbol xmlFree imported [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xml_pi.obj : warning LNK4049: locally defined symbol xmlFree imported [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xml_attribute.obj : warning LNK4049: locally defined symbol xmlFree imported [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xml_document.obj : warning LNK4049: locally defined symbol xmlFree imported [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xml_element.obj : warning LNK4049: locally defined symbol xmlFree imported [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xml_comment.obj : warning LNK4049: locally defined symbol xmlFree imported [E:\SS\Service\node_modules\libxmljs\build\xmljs.vcxproj]
xmljs.vcxproj -> E:\SS\Service\node_modules\libxmljs\build\Release\\xmljs.node
npm WARN tslint-eslint-rules@5.4.0 requires a peer of typescript@^2.2.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN resource@1.0.7 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","
arch":"any"} (current: {"os":"win32","arch":"x64"})
+ libxmljs@0.19.7
updated 1 package and audited 424 packages in 39.25s
23 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
However, when i compile my node application to executable, I need to put "xmljs.node" along with my app.exe to make it work. I am getting below error when i am trying to run my app.exe
Error: Module did not self-register: '\\?\E:\SS\Service\xmljs.node'.
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1248:18)
at Module.load (internal/modules/cjs/loader.js:1047:32)
at Function.Module._load (internal/modules/cjs/loader.js:935:14)
at Module.require (internal/modules/cjs/loader.js:1087:19)
at Module.require (pkg/prelude/bootstrap.js:1225:31)
at require (internal/modules/cjs/helpers.js:73:18)
at bindings (E:\snapshot\Service\node_modules\bindings\bindings.js:84:48)
at Object.<anonymous> (E:\snapshot\Service\node_modules\libxmljs\lib\bindings.js:1:99)
at Module._compile (pkg/prelude/bootstrap.js:1320:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1218:10)
Similar setup worked for libxmljs version0.19.5 with Node 10x.
I've also tried "npm rebuild" but still issue persist. Is there any other version we should be using with Node 12 on windows? Or, anything i am missing to generate xmljs.node?
Checked this with libxmljs support and found the version currently doesn't support Node v12+. It should be coming soon. More details at : libxmljs issue with Node12