Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible with node 10 #68

Closed
bosson opened this issue Jul 3, 2018 · 24 comments · Fixed by #84
Closed

incompatible with node 10 #68

bosson opened this issue Jul 3, 2018 · 24 comments · Fixed by #84

Comments

@bosson
Copy link

bosson commented Jul 3, 2018

As noted here: gagern/libxmljs#12
I too cant get past node 9 in :

%> npm install libxslt 

> libxmljs-mt@0.18.0 install /Users/bosson/Documents/workspace/sites/illuminet-se/node_modules/libxmljs-mt
> node-gyp rebuild

  CXX(target) Release/obj.target/xmljs/src/libxmljs.o
../src/libxmljs.cc:69:17: error: no member named 'IsDead' in 'v8::V8'
    if (v8::V8::IsDead())
        ~~~~~~~~^
1 error generated.
make: *** [Release/obj.target/xmljs/src/libxmljs.o] Error 1

libxmljs-mt seems stale.

@eorsi
Copy link

eorsi commented Jul 9, 2018

Seeing the same issue on node 10.06 on OSX:

npm i libxslt

> libxmljs-mt@0.18.0 install /Users/eorsi/workspace/case-api/node_modules/libxmljs-mt
> node-gyp rebuild

  CXX(target) Release/obj.target/xmljs/src/libxmljs.o
../src/libxmljs.cc:69:17: error: no member named 'IsDead' in 'v8::V8'
    if (v8::V8::IsDead())
        ~~~~~~~~^
1 error generated.
make: *** [Release/obj.target/xmljs/src/libxmljs.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/usr/local/Cellar/node/10.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/eorsi/workspace/case-api/node_modules/libxmljs-mt
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! libxmljs-mt@0.18.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the libxmljs-mt@0.18.0 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!     /Users/eorsi/.npm/_logs/2018-07-09T19_46_28_188Z-debug.log

@knuth-lover
Copy link

knuth-lover commented Jul 20, 2018

Having the same issue with node 10.6.0 on Windows 10... Any updates as to when this may be resolved? I had to start using Saxon-HE to get going but I'd much rather use this.

@RaviDesai
Copy link

Still occurring on node 10.7 on OS/X as well. Currently has me stymied. Are there any workarounds?

@eorsi
Copy link

eorsi commented Aug 6, 2018

@RaviDesai this will require an actual code fix - my current "workaround" is to keep my project at a lower version of node :(

@RaviDesai
Copy link

@eorsi Thanks. That's my "workaround" as well I guess. :(

@alexdee2007
Copy link
Contributor

For node 10 try this fork
https://github.com/alexdee2007/node-libxslt

npm i alexdee2007/node-libxslt

@MartijnR
Copy link

Thanks @alexdee2007. Your fix seems to work for me on node 10.9.0 (and also on node 8.11.2) on Mac OS. 🎉

Maybe @albanm would like a PR?

@alexdee2007
Copy link
Contributor

alexdee2007 commented Aug 23, 2018

Hello @MartijnR, you are welcome. Unfortunately there is also dependent repo libxmljs-mt, which is also need to be fixed. So I hope @gagern and @albanm will do it asap.

@belfour
Copy link

belfour commented Sep 12, 2018

HI,

Node v8.12.0, NPM v6.4.1

make: Entering directory '/home/project/node_modules/libxmljs-mt/build'
  CXX(target) Release/obj.target/xmljs/src/libxmljs.o
make: g++: Command not found
xmljs.target.mk:165: recipe for target 'Release/obj.target/xmljs/src/libxmljs.o' failed
make: *** [Release/obj.target/xmljs/src/libxmljs.o] Error 127
make: Leaving directory '/home/project/node_modules/libxmljs-mt/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/steve/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-33-generic

@MartijnR
Copy link

@belfour, that looks like a completely different issue. Would be good to move it to its own issue, I think.

@belfour
Copy link

belfour commented Sep 13, 2018

@MartijnR - done!

#70

thanks,
Steve

cmil added a commit to ubleipzig/histvv that referenced this issue Sep 19, 2018
The node libxslt package is currently not compaltible with node 10
(see albanm/node-libxslt#68).
@Nabrok
Copy link

Nabrok commented Oct 31, 2018

@alexdee2007 Trying to use your fork with electron. electron-rebuild works, but I get runtime error "The specified procedure could not be found.".

@kevteljeur
Copy link

Hi @albanm - I know you're not very invested in this project any more, but I'd like to ask you about it, since I'm blocked from upgrading Node.js in my project (by way of libxmljs-mt, which is now abandoned). Do you think that it is possible for me to rewrite parts of it to work with libxmljs, or is it too fixed to the libxmljs-mt interface?

I'm not a C or C++ developer, although I understand some of the code. Your library is good, so I'd prefer to work with this than go back to passing files to xsltproc :-)

@albanm
Copy link
Owner

albanm commented Feb 5, 2019

@gagern was the one putting some work into this after some report of hard bugs caused by a lack of concurrency management in libxmljs. He wrote libxmljs-mt and included it into this project to solve this. node-libxlst worked fine before that, except for these specific bugs.

I don't think there were that many changes done here to switch from libxmljs to libxmljs-mt. Maybe only the references to libxmljs::WorkerSentinel, cf https://github.com/albanm/node-libxslt/blob/master/src/node_libxslt.cc#L70

For minimal work I suppose this could be done:

  • create a fork of this lib
  • remove the async apis (to remove potential concurrency bugs)
  • remove WorkerSentinel references (probably already out after removing the async apis)
  • switch back to original libxmljs

The resulting fork would have a simpler code. But it would fail in one major way: if the processed stylesheets include other stylesheets the resulting IO operations will be performed in a blocking synchronous function.

Maybe forking libxmljs-mt, and updating it from libxmljs to support latest node would be a better solution. I have no idea of the complexity of the task.

@kevteljeur
Copy link

Thanks for such a quick response, @albanm - yes, I was looking at this and I understand why you have done it this way and why you used libxmljs-mt - it makes sense. The libxmljs-mt fork is unfortunately idle, there are some pull requests to solve this and try to make a working build for Node.js 10 (this is the real problem) but it seems that there's no movement.

I have asked about the changes to libxmljs-mt, there is some interest but little has happened. Your libraries are two of the three dependent on it, so there's not much traction for changes... Thanks again!

@kevteljeur
Copy link

Right, I'm back: I reread the thread on libxmljs-mt, and followed the instructions here, to get a Node.js 10.x compatible build of libxmljs-mt. That works! Which is great.

However, getting a build of node-libxslt seems to be a little harder. I've repointed the dependency for libxmljs-mt to my local build, but I got the error below:

14 warnings generated.
  CXX(target) Release/obj.target/node-libxslt/src/stylesheet.o
../src/stylesheet.cc:29:52: error: no matching member function for call to 'NewInstance'
    Local<Object> wrapper = Nan::New(constructor)->NewInstance();
                            ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/Users/EC-KT/.node-gyp/10.15.0/include/node/v8.h:3996:44: note: candidate function not viable: requires single argument 'context', but no arguments were
      provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/EC-KT/.node-gyp/10.15.0/include/node/v8.h:3993:44: note: candidate function not viable: requires 3 arguments, but 0 were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
1 error generated.
make: *** [Release/obj.target/node-libxslt/src/stylesheet.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/opt/local/node10/bin/node" "/opt/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/EC-KT/Documents/Work/Web-forms/Development/Branches/Resources/1.8-updates/node-libxslt-new
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! libxslt@0.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the libxslt@0.7.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

So this relates to the C bridge and nan, using some calls that are deprecated with Node.js 8.x and unsupported by Node.js 10.x. So I'm looking at that - and learning a lot!

@kevteljeur
Copy link

@albanm The issue is in stylesheet.cc:
29: Local<Object> wrapper = Nan::New(constructor)->NewInstance(); should be:
Local<Object> wrapper = Nan::NewInstance(Nan::New(constructor)).ToLocalChecked();

With this, it will build and work with Node.js 10.x. There are other deprecations, so I will need to look at those. If I fork and fix, would you like me to submit the changes back to you?

@albanm
Copy link
Owner

albanm commented Feb 6, 2019

Yes, pull requests are always welcome.

@albanm
Copy link
Owner

albanm commented Feb 6, 2019

Except if you wish to maintain the fork from now on.. In this case I will gladly transfer ownership of the npm name :)

@kevteljeur
Copy link

With great power comes great responsibility! Ok, we can look at this, because you have done wonderful work with this module and it will be your 'calling card' for years to come. But if you are tired of it, maybe it can help too.

Thanks again for responding!

@aifeipeng
Copy link

I don't want to come off as prick, but is this being worked on? Is it possible to help out in some way?

@andreafalzetti
Copy link

I am having the same issue: error: no member named 'IsDead' in 'v8::V8'

@MartijnR
Copy link

Pending PR: #73

@MartijnR
Copy link

issue can be closed, I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.