request: Regression: Hawk update broke compatibility with Node 6.10

For some reason that I don’t quite understand, npm in Node6 completely ignores the fact that sntp package.json has "node": ">=8.9.0" in it and installs this very version as a dependency of updated hawk. 30 minutes ago you updated request and my app has completely gone out of production with SyntaxError: exports.time = async function (options = {} ) {

The problem is, I don’t install request directly, it is installed as a dependency of another package I have no control over. And it requires "request": "^2.53.0". Also I cannot change node version, since 6.10 is the latest available in AWS Lambda.

I really have no idea how to fix this on my end. Please help…

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 70
  • Comments: 30 (4 by maintainers)

Commits related to this issue

Most upvoted comments

v2.85.0 is published

I’ve reverted the update to Hawk 7.x and hopefully this is going to fix the issue, because right now the tests on TravisCI are failing for Node >= v8 for some reason, the tests for Node < v8 are failing because of sntp dev dep, and locally the test are failing for yet another reason … Anyway will publish a new version shortly.

The first goal would be to get our tests working again. I guess that’s the reason why this got merged in without anyone noticing it.

Then hawk should not be updated to > v7 anytime soon, because of the breaking change for Node < 8.9.0. It was excluded from Greenkeeper long time ago, exactly because of the constant breaking changes: https://github.com/request/request/blob/v2.85.0/package.json#L82-L87 it was for Node < v4 at that time

For reasons why we won’t/can’t bump the major version here, you can read @mikeal’s comments about it in this issue tracker.

Thanks for your patience! 👍

Thank you for the quick response/fix. It works again. 👍 💯 Maybe you could consider to introduce such a breaking change as a major update instead of a minor? I guess it would be less ‘stressy’ for all of us. 😅

image Same here.

Same error for firebase cloud functions

Detailed stack trace: /user_code/node_modules/request/node_modules/sntp/lib/index.js:19
exports.time = async function (options = {}) {
                     ^^^^^^^^

SyntaxError: Unexpected token function

Fixed by locking version at "request": "2.83.0".

This has happened to us also. We’re using Jest, which pulls in this module, so as of an hour ago all our builds are now broken. We’re also working with AWS Lambda so have to target Node 6.

Given how many other people are likely in the same situation this could break a lot of things!

+1 Getting this too

same here, installing jest@21 with yarn@1.3.2 => broken CI

$ yarn install
yarn install v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
error hawk@7.0.7: The engine "node" is incompatible with this module. Expected version ">=8.9.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR: Job failed: exit code 1