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

Node 12 does not support null coalescing operator #1741

Closed
Kevmo92 opened this issue Oct 5, 2022 · 11 comments
Closed

Node 12 does not support null coalescing operator #1741

Kevmo92 opened this issue Oct 5, 2022 · 11 comments
Labels
investigating We're actively investigating this issue

Comments

@Kevmo92
Copy link

Kevmo92 commented Oct 5, 2022

Summary

Running sfdx with node 12 no longer works

Steps To Reproduce:

  1. Have node 12 setup
  2. install sfdx cli npm i -g [email protected]
  3. run sfdx --version

Expected result

The version of sfdx is displayed

Actual result

/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/@salesforce/kit/lib/env.js:18
    constructor(store = process?.env || {}) {
                                ^

SyntaxError: Unexpected token '.'
    at new Script (vm.js:88:7)
    at NativeCompileCache._moduleCompile (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
    at Module._compile (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/v8-compile-cache/v8-compile-cache.js:184:36)
    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 (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/@salesforce/kit/lib/index.js:25:14)
    at Module._compile (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)

System Information

  • Which shell/terminal are you using? (e.g. bash, zsh, powershell 5, powershell 7, cmd.exe, etc.)

  • bash

  • If you are using sfdx

    • Run sfdx version --verbose --json
  • If you are using sf

    • Run sf version --verbose --json
 sfdx version --verbose --json
/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/@salesforce/kit/lib/env.js:18
    constructor(store = process?.env || {}) {
                                ^

SyntaxError: Unexpected token '.'
    at new Script (vm.js:88:7)
    at NativeCompileCache._moduleCompile (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
    at Module._compile (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/v8-compile-cache/v8-compile-cache.js:184:36)
    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 (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/@salesforce/kit/lib/index.js:25:14)
    at Module._compile (/Users/kevinwatson/.fnm/node-versions/v12.22.12/installation/lib/node_modules/sfdx-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)

Additional information

Feel free to attach a screenshot.

@Kevmo92 Kevmo92 added the investigating We're actively investigating this issue label Oct 5, 2022
@github-actions
Copy link

github-actions bot commented Oct 5, 2022

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@cristiand391
Copy link
Member

Hey @Kevmo92 node v12 isn't supported anymore.

We bundle the current LTS node with our installers and support node >= current maintenance for npm installs.

See:
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm
https://github.com/nodejs/release#release-schedule

@cristiand391 cristiand391 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2022
@Kevmo92
Copy link
Author

Kevmo92 commented Oct 5, 2022

Hey @Kevmo92 node v12 isn't supported anymore.

We bundle the current LTS node with our installers and support node >= current maintenance for npm installs.

See: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm https://github.com/nodejs/release#release-schedule

@cristiand391 I understand the latest version of sfdx doesn't work with node 12. However the 7.96.1 was working with node 12 until this dependency was updated yesterday https://www.npmjs.com/package/@salesforce/kit

Before that it was using (process && process.env) but the new version uses process?.env. So it seems like the sfdx dependencies aren't locked and this is causing the error when running 7.96.1 now

@ChaseBowen
Copy link

We have large codebases that we are currently in the process of converting off of node 12 now to newer versions. This sfdx version was the last one to support node 12 and it has been working fine until a recent dependency update. Why are dependency versions being updated on an older version of sfdx? I assumed those dependency versions would be pinned since this is a pinned version of sfdx (7.96.1)

@Kevmo92
Copy link
Author

Kevmo92 commented Oct 5, 2022

forcedotcom/kit@1.6.1...1.7.0 <- breaking changes made here

@Kevmo92
Copy link
Author

Kevmo92 commented Oct 5, 2022

@cristiand391 ^

@cristiand391
Copy link
Member

cristiand391 commented Oct 5, 2022

@Kevmo92 @ChaseBowen
we started locking dependencies with a shrinkwrap lockfile in sfdx v7.165.0, see: #1678

all sfdx versions installed with npm before that ⬆️ will get the latest version of dependencies because of carets, even if we revert the change made in kit your setup can be broken by any other dep not owned by us.

For these cases we suggest to use the tarballs during your migration as those include the dependencies, a teammate found the tarballs for sfdx v7.96.0:

linux: https://developer.salesforce.com/media/salesforce-cli/sfdx/versions/7.96.0/633fe15/sfdx-v7.96.0-633fe15-linux-x64.tar.gz
darwin: https://developer.salesforce.com/media/salesforce-cli/sfdx/versions/7.96.0/633fe15/sfdx-v7.96.0-633fe15-darwin-x64.tar.gz
win: https://developer.salesforce.com/media/salesforce-cli/sfdx/versions/7.96.0/633fe15/sfdx-v7.96.0-633fe15-win32-x64.tar.gz

Please note that the tarballs include the node binary, if the only reason you were using an old sfdx version is because of other code requiring node v12 to be used you all should use the tarballs (or the installers found here) and install the latest stable release, it will use its own binary and you can still use v12 for other projects.

@ChaseBowen
Copy link

Thanks for the suggestions @cristiand391

@Brian-Triplett
Copy link

@cristiand391 that's super helpful and a great workaround.

By chance to you have the tar for 7.96.1?

@cristiand391
Copy link
Member

@Brian-Triplett we don't see the tarballs listed for v7.96.1 in our server.

@Brian-Triplett
Copy link

Thanks for checking though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

4 participants