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

Unable to install trianglify on node 8.11.4 #99

Closed
wisyr opened this issue Dec 8, 2018 · 2 comments
Closed

Unable to install trianglify on node 8.11.4 #99

wisyr opened this issue Dec 8, 2018 · 2 comments

Comments

@wisyr
Copy link

wisyr commented Dec 8, 2018

While installing trianglify on node (ver 8.11.4) for Server Side Rendering purposes, I'm getting numerous warnings and errors in the console, related with e.g. node-pre-gyp, node-gyp etc. It happens in linux console. However it works properly locally, on node 8.11.1 on windows.

/usr/include/machine/pcb.h:58:2: error: unknown type name 'register_t'; did you
      mean '__register_t'?
        register_t      pcb_rbx;        /* (*) */
        ^
/usr/include/x86/_types.h:108:19: note: '__register_t' declared here
typedef __int64_t       __register_t;
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake: *** [canvas.targ


node-pre-gyp ERR! node -v v8.11.4
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok

Is it the fault of the dependencies, which trianglify is using? LF solution.

Currently I'm unable to use this lib in my project, unfortunately.

@qrohlf
Copy link
Owner

qrohlf commented Dec 18, 2018

If you're using this for SSR, I assume you're going to be outputting SVG rather than <canvas>, right?

This looks like an issue with the node-canvas dependency, which is only needed if you're trying to render to <canvas> or PNG. If you're outputting to SVG, just don't install node-canvas and you should be fine.

If this is happening without the canvas package in your dependencies list, then I'm going to need more information about the specific OS version you're trying to install on so I can attempt to reproduce.

@wisyr
Copy link
Author

wisyr commented Dec 21, 2018

I did a workaround. Since I'm not using trianglify on server side, I have made a conditional import using require. If client, require trianglify, if server - do not import anything.

And actually it worked. One more thing though - the dependency on server side has to be placed inside devDependencies, else it will drop the npm install with multiple errors.

P.S. Thank you for an outstanding library. This is a pure gold.

@qrohlf qrohlf closed this as completed Oct 15, 2019
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

No branches or pull requests

2 participants