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

Regression: Hawk update broke compatibility with Node 6.10 #2891

Closed
constb opened this issue Mar 12, 2018 · 30 comments
Closed

Regression: Hawk update broke compatibility with Node 6.10 #2891

constb opened this issue Mar 12, 2018 · 30 comments

Comments

@constb
Copy link

constb commented Mar 12, 2018

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…

@hutchy2570
Copy link

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!

@mdluo
Copy link

mdluo commented Mar 12, 2018

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".

@mickhansen
Copy link

#2880

@cpu220
Copy link

cpu220 commented Mar 12, 2018

+1

@lironzluf
Copy link

+1
Getting this too

@Nubzor
Copy link

Nubzor commented Mar 12, 2018

+1

Try to add request 2.38.0 to your devDependencies - should help.

@balazs4
Copy link

balazs4 commented Mar 12, 2018

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

@xu3u4
Copy link

xu3u4 commented Mar 12, 2018

image
Same here.

@ranlandau
Copy link

We are failing deployment to production with all of our services.
The quick fix is massive work.

Any word from @simov ??

@constb
Copy link
Author

constb commented Mar 12, 2018

I made a workaround using npm shrinkwrap. I added file next to package.json under the name of npm-shrinkwrap.json:

{
  "dependencies": {
    "some-package": {
      "version": "2.0.0",
      "from": "some-package@^2.0.0",
      "dependencies": {
        "request": {
          "version": "2.83.0",
          "from": "request@^2.53.0"
        }
      }
    },
    "other-package": {
      "version": "1.0.2",
      "from": "other-package@^1.0.2",
      "dependencies": {
        "request": {
          "version": "2.83.0",
          "from": "request@^2.83.0"
        }
      }
    }
  }
}

Now npm install puts previous request version in node_modules.

Then I had to patch node_modules/serverless-webpack/lib/packagers/npm.js to include npm-shrinkwrap.json into the build instead of package-lock.json. Now after deploy I have working lambdas.

Hopefully this will be fixed soon…

@kenken17
Copy link

Same here...

@GiambiHuang
Copy link

+1...

@yutackall
Copy link

+1

@trailskr
Copy link

+1 =(

@washswat
Copy link

+1

@ranlandau
Copy link

+10000000000000000000000000000000000000000000

@ozamarripa
Copy link

+1

@simov
Copy link
Member

simov commented Mar 12, 2018

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.

@hashar
Copy link

hashar commented Mar 12, 2018

In case it can help, the dependency chain we had:

OK: nodemw@0.11.0 -> request@2.83.0 -> hawk@6.0.2 -> sntp@2.1.0

FAIL: nodemw@0.11.0 -> request@2.84.0 -> hawk@7.0.7 -> sntp@3.0.1

Thank you @simov !!!

@fott1
Copy link

fott1 commented Mar 12, 2018

Request version 2.83.0 fixed it, for now.

@simov
Copy link
Member

simov commented Mar 12, 2018

v2.85.0 is published

@balazs4
Copy link

balazs4 commented Mar 12, 2018

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. 😅

@androidfanatic
Copy link

+1, fixed now. Thanks.

@lironzluf
Copy link

+1
Can confirm it's fixed

@Rakk4403
Copy link

+1 Good

@jamescodesthings
Copy link

+1 Circle is happy with us now. Ty.

@simov
Copy link
Member

simov commented Mar 12, 2018

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! 👍

@txiaocao
Copy link

+1

@simov
Copy link
Member

simov commented May 28, 2018

see #2943

@simov simov closed this as completed May 28, 2018
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