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

4.1.0 not supported on Node 12 #2117

Closed
bizob2828 opened this issue May 3, 2022 · 10 comments
Closed

4.1.0 not supported on Node 12 #2117

bizob2828 opened this issue May 3, 2022 · 10 comments
Labels

Comments

@bizob2828
Copy link

bizob2828 commented May 3, 2022

This may be expected based on this PR but I don't see a changelog entry for 4.1.0 yet.

Steps to reproduce

Expected Result

module works as expected

Actual Result

crash because library is using optional chaining.

node_modules/redis/dist/index.js:42
            ...options?.modules
                       ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/revans/code/pull-requests/node-newrelic/test/versioned/redis/test.js:1:15)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Environment:

  • Node.js Version: 12.22.12
  • Redis Server Version: N/A
  • Node Redis Version: 4.1.0
  • Platform: N/A
@bizob2828 bizob2828 added the Bug label May 3, 2022
@bizob2828
Copy link
Author

bizob2828 commented May 3, 2022

I'm actually going to close this. I forgot LTS support was dropped last week. It would've been nice if this followed semantic versioning though and semver major bumped dropping Node 12.

@rithuacharya
Copy link

Hey @bizob2828 , is the optional chaining removed, my strapi application using docker fails because of this change. Using node v14 in docker doesn't work either. Please update on this issue. Thanks.

@munetta
Copy link

munetta commented May 17, 2022

same issue. can someone point to proper fix.

@guptaarpit
Copy link

Still facing the same issue for docker node:14-alpine, Can someone help with what needs to be on Docker

@bhartendu27
Copy link

Upgrading my node version to current stable version fixed it for me. (my strapi version: 3.6.8)

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

@rithuacharya
Copy link

Upgrading the node version to v14 (node:14.19-alpine3.15 in my case) in Dockerfile fixed the issue for me.

@uvinod
Copy link

uvinod commented May 26, 2022

node: v16.15.0
Redis server v=6.0.16
redis: "^4.1.0"

I have the same issue. Can someone assist me with the fix?

@Luxiorawa
Copy link

The "issue" may be fixed by changing package.json. In my case, i had the following dependency "redis": "^4.0.6".

The "^" sign means that it can upgrade patch version, or minor version. 4.1.0 is a minor version, so i couldn't launch my app because my node version is 12.15.0 (thus, not including optional chaining)

In case you want one specific version, you can specify so in the package.json by specifying "redis": "4.0.6" (without "^").

@well1791
Copy link

well1791 commented Jul 1, 2022

Isn't there a way to require a minimum node version so that it's visible to everyone facing this issue?

/// package.json
"engines" : { 
  "npm" : ">=14",
}

or something like this

In any case, these are the only lines that provide visibility

"@tsconfig/node14": "^1.0.3",

"extends": "@tsconfig/node14/tsconfig.json",

@stockarea
Copy link

I am getting this on node version 20 as well.

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

No branches or pull requests

9 participants