saxon-node
saxon-node copied to clipboard
Issue installing saxon-node
I'm having trouble installing saxon-node on my machine
- macOS 10.15.1 (Catalina)
- Node 12.13.1 (Current LTS)
I've followed the instructions in the saxon-node documentation -
npm install saxon-node --fallback-to-build
export SAXONC_HOME=/path/to/saxon
export LD_LIBRARY_PATH=$SAXONC_HOME:$SAXONC_HOME/rt/lib/amd64/jetvm:$SAXONC_HOME/rt/lib/amd64:$LD_LIBRARY_PATH
Anytime I try and install it fails to find pre-built binaries which is fine, but it fails to build also. Here's the stack trace
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://saxon-node.s3-us-west-2.amazonaws.com/v0.2.1/saxonXslt-v0.2.1-node-v72-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download: https://saxon-node.s3-us-west-2.amazonaws.com/v0.2.1/saxonXslt-v0.2.1-node-v72-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI) (falling back to source compile with node-gyp)
make: *** No rule to make target `Release/obj.target/saxonXslt//Users/mulligan/Desktop/saxon/saxoc-he/Saxon.C.API/SaxonCGlue.o', needed by `Release/saxonXslt.node'. Stop.
make: *** No rule to make target `Release/obj.target/saxonXslt//Users/mulligan/Desktop/saxon/saxoc-he/Saxon.C.API/SaxonCGlue.o', needed by `Release/saxonXslt.node'. Stop.
gypgyp ERR! build error
ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/mulligan/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gypgyp ERR!ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/mulligan/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR!gyp stack at ChildProcess.emit (events.js:210:5)
ERR!gyp ERR!System Darwin 19.0.0
stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! command "/Users/mulligan/.nvm/versions/node/v12.13.1/bin/node" "/Users/mulligan/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/mulligan/Desktop/saxon/node_modules/saxon-node/lib/binding/saxonXslt.node" "--module_name=saxonXslt" "--module_path=/Users/mulligan/Desktop/saxon/node_modules/saxon-node/lib/binding"
gyp ERR! gypcwd /Users/mulligan/Desktop/saxon/node_modules/saxon-node
gypERR! ERR! Systemnode -v Darwin 19.0.0
v12.13.1
gyp ERR! node-gyp -vgyp v5.0.5
gypERR! command "/Users/mulligan/.nvm/versions/node/v12.13.1/bin/node" "/Users/mulligan/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/mulligan/Desktop/saxon/node_modules/saxon-node/lib/binding/saxonXslt.node" "--module_name=saxonXslt" "--module_path=/Users/mulligan/Desktop/saxon/node_modules/saxon-node/lib/binding"
ERR!gyp ERR!not ok cwd
/Users/mulligan/Desktop/saxon/node_modules/saxon-node
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/mulligan/.nvm/versions/node/v12.13.1/bin/node /Users/mulligan/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/mulligan/Desktop/saxon/node_modules/saxon-node/lib/binding/saxonXslt.node --module_name=saxonXslt --module_path=/Users/mulligan/Desktop/saxon/node_modules/saxon-node/lib/binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/mulligan/Desktop/saxon/node_modules/saxon-node/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:210:5)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Darwin 19.0.0
node-pre-gyp ERR! command "/Users/mulligan/.nvm/versions/node/v12.13.1/bin/node" "/Users/mulligan/Desktop/saxon/node_modules/saxon-node/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/mulligan/Desktop/saxon/node_modules/saxon-node
node-pre-gyp ERR! node -v v12.13.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.30
node-pre-gyp ERR! not ok
Failed to execute '/Users/mulligan/.nvm/versions/node/v12.13.1/bin/node /Users/mulligan/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/mulligan/Desktop/saxon/node_modules/saxon-node/lib/binding/saxonXslt.node --module_name=saxonXslt --module_path=/Users/mulligan/Desktop/saxon/node_modules/saxon-node/lib/binding' (1)
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Any help would be greatly appreciated Thanks!
Hi @mulligandev
You need the v12 branch currently for that version of node https://github.com/rimmartin/saxon-node/tree/v12
I'm working on tests for saxon processor 3.0 and then will publish both for older node versions and v12 onward
I've been digging into this issue and I learned quite a bit:
-
saxon-node still fails to build, even on the v12 (and master which it was merged into) branch. You can see that error here: https://travis-ci.org/charlocharlie/saxon-node/jobs/631080912
-
The
SaxonCGlue.o', needed by 'Release/saxonXslt.node'.error occurs only when installing saxon-node as a dependency, regardless of Node version.
I set up two identical Node 10/Linux environments using Docker images modeled from the Travis build:
- One contained the cloned saxon-node project
- The other had the saxon-node master branch added as a dependency (
"saxon-node": "git://github.com/rimmartin/saxon-node.git").
I ran npm install --build-from-source --saxonc_home=./Saxonica/SaxonHEC1.2.0 on both environments.
- The first environment passed the build fine
- The second environment failed with the
SaxonCGlue.o', needed by 'Release/saxonXslt.node'.error.
Not sure how to resolve this. I may just end up transplanting the build from the cloned container to use at runtime.
Hi @charlocharlie, merging is not good at this time
https://travis-ci.org/rimmartin/saxon-node/builds/602109194 was with nodejs v11. I'll build today with v12 and v13
One of the things that held me up was cloning the xslt 3.0 tests to check out the use of the saxon 3.0 processor.
Also you'll want SaxonHEC1.2.1
@mulligandev I was able to get past the SaxonCGlue.o', needed by 'Release/saxonXslt.node' error when installing as a dependency (on Node 10, however). The main issue is that you must use --saxonc_home= on your npm install, and it must be a relative directory to ${ProjectDir}/node_modules/saxon-node/.
Here's an example Dockerfile I was able to get to work: https://gist.github.com/charlocharlie/5fe02407d27c69ce5dcdb59a787e462d
@rimmartin Regarding Node 12 stuff, I thought it was finished because of #26. Looking forward to its proper release, though. It looks like the core problem of this issue was just a --saxonc_home= problem.
@charlocharlie,I'm taking care of deprecations and then it should finally work for v12 a v13.
The switch issue might be because of changes in npm(or pnpm) where they get set by the config
pnpm config set saxonc_home $SAXONC_HOME
pnpm config set build-from-source true
I'm testing this on my local build and will change the documentation if it is so.
@charlocharlie, are you using xslt 3.0 features?
I only plan on using xslt 2.0 for now.
I was able to get my project to build saxon-node and pass the tests from master. 🎉 I updated my Dockerfile with my current working config and a few comments: https://gist.github.com/charlocharlie/5fe02407d27c69ce5dcdb59a787e462d
Just as a heads up, SaxonHEC1.2.1 fails to build, so I'm still just using 1.2.0.
saxon-c 1.2.1 fixes a missing implementation of isSchemaAware. If you aren't using a saxon-c pro or enterprise license then this isn't a problem on mac or linux; windows 1.2.0 won't compile.
I use 1.2.1 in c++ projects no problem; will be testing with this project shortly; getting thru the deprecations
v12 branch built for linux and mac for node v11 and v12 and saxon-c 1.2.1 https://travis-ci.org/rimmartin/saxon-node/builds/631367290
making deprecation changes for node v13
node v8 thru v11 are building on master with saxon-c 1.2.1 and for linux and mac. https://travis-ci.org/rimmartin/saxon-node/builds/631367045
node v12 and v13 are building on branch v12 with saxon-c 1.2.1 and for linux and mac. https://travis-ci.org/rimmartin/saxon-node/builds/631382087
I don't have a windows box so I'll have to tinker with travis yaml to see why it isn't building windows anymore
for windows it looks like choco java-12-openjdk-12.0.2-1 isn't there anymore; checking...
v12 branch with nodejs v12 & v13 all passing including windows https://travis-ci.org/rimmartin/saxon-node/builds/631410637
master with nodejs v8 thru v11 all passing including windows https://travis-ci.org/rimmartin/saxon-node/builds/631411512
I was able to upgrade my config to the v12 branch. Thanks for all the work you put in @rimmartin!
@charlocharlie great! I'll publish it this coming weekend
I get the same error on goorm, running node v10.15.3 in a ubuntu 14.04. version. (even when creating a new containre, I only get Node.JS 10.16.3)
npm install saxon-node --fallback-to-build
However, I really do not know whether I installed Saxon-HEC correctly, as the Installation instructions that I found are not the best, imho ...
On 9 Jan 2020, at 14:53, karanda1990 [email protected] wrote:
However, I really do not know whether I installed Saxon-HEC correctly, as the Installation instructions that I found are not the best, imho ...
Maybe I can help you with the installation. Are you using the instructions here: https://www.saxonica.com/saxon-c/documentation/index.html#!starting/installing https://www.saxonica.com/saxon-c/documentation/index.html#!starting/installing
What platform are you targeting?
kind regards,
O'Neil
Yes, I used those instructions!
What platform are you targeting?
As mentioned above, I run it on Node 10.15.3, ubuntu 14.04. I used SaxonHEC 1.2.1 (which I forgot to mention earlier)
Hi,
npm install --build-from-source --saxonc_home=<YOUR_SAXONC_HOME>
also you may need to clone from this repository rather than use npm repository
I'll see about publishing to npm tonight
or
npm install --fallback-to-build --saxonc_home=<YOUR_SAXONC_HOME>