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

Add support for Node > 8 #537

Closed
wants to merge 7 commits into from
Closed

Add support for Node > 8 #537

wants to merge 7 commits into from

Conversation

Dabolus
Copy link

@Dabolus Dabolus commented Dec 20, 2018

This PR adds support for Node > 8 by updating the node-pre-gyp dependency of the Node binding for Snowboy. I tested it locally using Node 10.15.0 and it builds without any issues. Updating this dependency will also fix some severe vulnerabilities caused by the outdated dependency. The only small downside is that node-pre-gyp dropped the support for Node 0.10.x (which was released more than 5 years ago and reached its end of life 2 years ago, so it shouldn't be a big problem). Node 10 and 11 have also been added to Travis matrix.

Fixes #536

@evancohen
Copy link
Contributor

Happy New Year! I think this is a worth while change.
It's 2019, the node bindings should support Node > 8 🤣. Happy to test this out and confirm it works if that will get it merged.

@evancohen
Copy link
Contributor

I made this change on my own local branch evancohen@a6e3c83, and it looks like the build for Node 8.0.0 failed: https://travis-ci.org/evancohen/snowboy/builds/477664987

@Dabolus do you know why that might be? It looks like node-pre-gyp isn't found, just for that version, on both OSX and Linux. For some odd reason the work-around that I had in .travis.yml#L52 doesn't work in this case.

@Dabolus Dabolus changed the title Update node-pre-gyp dependency Add support for Node > 8 Jan 11, 2019
@Dabolus
Copy link
Author

Dabolus commented Jan 12, 2019

@evancohen that's really strange. I tried to build on Travis too with my repo and I had the exact same issue. However, if I follow the same steps with Node 8.0.0 installed with nvm on my local machine, everything works like a charm. Still investigating.

BTW probably not related, but I think that Travis should not run on Node x.0.0, but on the latest minor.patch of each Node version. The first release of each new major always has some bugs.

@evancohen
Copy link
Contributor

evancohen commented Jan 12, 2019

This is likely to do with some funky change that was made in the way that the 8.x version of Node/npm reads or sets environmental variables.

Speaking of major releases always having some bugs, maybe using the latest version of 8.x will solve the issue! I kicked off a build with that (evancohen@2d51ae0) here:
https://travis-ci.org/evancohen/snowboy/builds/478843913

Edit: and would you look at that! Green across the board 🍾

@Dabolus
Copy link
Author

Dabolus commented Jan 12, 2019

Glad to know that worked! Updating my branch too right now. It would be great to have some feedback from Snowboy maintainers, though.

@WoodySlum
Copy link

Hi, thanks for fixing. Would it be possible to merge ? I had to disable snowboy in my app due to unsupport of node 10 on rpi.

@evancohen evancohen mentioned this pull request Feb 9, 2019
Copy link

@imrrahul imrrahul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! It will be very useful if added in documentation

@mreinstein
Copy link

can we please get this merged? Node 6 is on the verge of being deprecated https://nodejs.org/en/about/releases/

@evancohen
Copy link
Contributor

I did some investigating and I put together an easy way to install snowboy (v1.3.1) that is compatible with Node 6-12 and has precompiled binaries for darwin (OSX), x64 (most Linux), and ARM (Pi). All you've got to do is run:

npm install snoyboy@sonus

@louistiti
Copy link

Thanks @evancohen!

It works like a charm.

@sdetweil
Copy link

sdetweil commented Nov 26, 2019

@evancohen Evan, the npm install snowboy@sonus, did not work on node 10.17(today), ubuntu on armv71. same compile failure as before

the error is unable to find module nan
Error: Cannot find module 'nan'

but you cannot install nan , as it fails to build snowboy... round and round

@evancohen
Copy link
Contributor

Not sure why this stopped working all of a sudden, I'll take a look when I get the chance.
Happy thanksgiving 🦃

@MrWook
Copy link

MrWook commented Mar 7, 2020

Any updates for this?
Would love to use snowboy

@scomans
Copy link

scomans commented Mar 26, 2020

For those who get the nan error and use Yarn you can do add the following to your package.json:

  "resolutions": {
    "snowboy/node-pre-gyp": "^0.14.0"
  }

@louistiti
Copy link

Hello everyone 👋,

Since a while, with the npm install snoyboy@sonus fix I was getting the following error after the install:

Error: Cannot find module 'nan'

I forked it and moved the nan module from the devDependencies to dependencies in the package.json file.
Also, I updated node-pre-gyp to @mapbox/node-pre-gyp as the original one seems deprecated.

My fork is currently working with Node.js 14.16.0.

Hope that helps.

@evancohen evancohen mentioned this pull request Jan 11, 2022
@Dabolus
Copy link
Author

Dabolus commented Nov 18, 2023

Well, my PR is quite outdated and this repo has been abandoned since a long time, so I will close it to tidy things up. Check one of the many forks if you need to use snowboy in applications using an up-to-date Node.js version.

@Dabolus Dabolus closed this Nov 18, 2023
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 this pull request may close these issues.

Update node-pre-gyp dependency
9 participants