Since this morning, it is not anymore possible to install SFDX-CLI on nodeJS v12, which is the one version documented as minimale to work.
Have active nodeJS 12.
try installing the sfdx-cli
sfdx-cli installs
00:00:45.138 [1/4] Resolving packages...
00:00:47.719 warning sfdx-cli > salesforcedx > salesforce-alm > [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
00:00:47.719 warning sfdx-cli > salesforcedx > salesforce-alm > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
00:00:47.719 warning sfdx-cli > @salesforce/plugin-alias > @salesforce/core > jsforce > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
00:00:47.719 warning sfdx-cli > salesforcedx > salesforce-alm > jsforce > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
00:00:47.719 warning sfdx-cli > @salesforce/plugin-generator > yeoman-generator > yeoman-environment > npm-api > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
00:00:49.669 warning sfdx-cli > salesforcedx > salesforce-alm > request > [email protected]: this library is no longer supported
00:00:50.633 warning sfdx-cli > @salesforce/plugin-generator > yeoman-environment > globby > fast-glob > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
00:00:50.633 warning sfdx-cli > @salesforce/plugin-generator > yeoman-environment > globby > fast-glob > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
00:00:50.901 [2/4] Fetching packages...
00:01:17.709 error [email protected]: The engine "node" is incompatible with this module. Expected version ">=14". Got "12.16.2"
00:01:17.709 error Found incompatible module.
Seems like as a few months ago, it is because of not defined enough version of dependency that makes the install (or the use) not working anymore.
_Feel free to attach a screenshot_.
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
OS and version:
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.
We also ran into this today and since we are not in a position to upgrade the Node js to v14 just yet, we had to use --ignore-engines flag with Yarn. It has bit us in the past as well.
Hello @clairebianchi, @ntotten - I don't know about the complexities it would present at your end, but ideal way for the Salesforce CLI is to support all the Node.js versions which are not EOL yet. For instance, Node v10.x is in maintenance and will be EOL in 04/21. Similarly Node v12.x will not be EOL until 04/22.
We have seen in the past that different sfdx plugins from salesforce have different Node.js version requirements. Unless otherwise something really requires a latest Node.js version, I would like to believe that the support for older versions should be maintained. Why would you want a user to be forced to use Node.js v14.x now, when Node.js v12 itself will be active for another 1.5 years (almost)?
I am really looking forward to read your thoughts on this.
The problem here is definitely a not forced version pick for antlr4 module in salesforce-alm module.
antlr4 indicated a minimum of nodeJS 14 in their latest version of the module.
@saurabh-deep : is everything working while installed with --ignore-engine ? even soql queries ? (because issue #747 looks a lot the same as here)
@KevinGossentCap - thank you for clarifying and for posting the issue on antlr4. The CLI generally uses caret dependencies and relies on others in the NPM community to respect semver in regards to backwards incompatible changes.
It might be helpful to reference this closed issue where a similar break occurred. https://github.com/forcedotcom/cli/issues/464
Hi @shetzel , would be urgent to sortout this point as antlr4 doen't want to do anything on it themselves : https://github.com/antlr/antlr4/issues/2970
their only answer : remove the caret to force the version... or maybe putting a tilde~ to only accept patches ?
@shetzel Additional info, for people that can't move to nodeJS v14, we can't install/use/update sfdx-cli anymore.
We found that the latest usable sfdx-cli version is 7.70.1 because of the "antlr4 : ^4.7.2" in salesforce-alm that would need to be replaced by "antlr4 : 4.7.2" or "antlr4 : ~4.7.2" or "antlr4 : 4.8.0" or "antlr4 : ~4.8.0"
Thus I think it could be a good thing to bring a compatibility patch even if no version of sfdx-cli is planned for this week
Same problem here, can't issue sfdx query since....
That break our CI/CD pipeline. Please patch it.
Thanks @KevinGossentCap for redirecting to this issue
On my side I found a few ways to workaround
"resolutions": {"antlr4": "<=4.8.0"}{"lockfileVersion":1,"dependencies":{"antlr4":{"version":"~4.8.0","from":"antlr4@^4.7.2"}}}I just discovered a easier method to globally install that works both for npm and yarn
npm -g uninstall sfdx-cli or yarn global remove sfdx-clinpm -g i [email protected] or yarn global add [email protected]npm -g i sfdx-cli or yarn global add sfdx-cli (beauty of dependency algorithms, they will find a globally installed version "4.8.0" compatible with the asked version in dependency tree "^4.7.2")Makes it all working (even the SOQL queries that crash in nodeJS14 with [email protected]) and easier than any other workaround I found for the meantime
@KevinGossentCap thanks for this!
I just discovered a easier method to globally install that works both for npm and yarn
- if you have sfdx-cli, remove/unstall it
npm -g uninstall sfdx-clioryarn global remove sfdx-cli- force install globally an acceptable version of antlr4
npm -g i [email protected]oryarn global add [email protected]- install your sfdx-ci
npm -g i sfdx-clioryarn global add sfdx-cli(beauty of dependency algorithms, they will find a globally installed version "4.8.0" compatible with the asked version in dependency tree "^4.7.2")Makes it all working (even the SOQL queries that crash in nodeJS14 with [email protected]) and easier than any other workaround I found for the meantime
Hum, work on local windows computer, but not on Linux Jenkins nodes 😭
It even breaks on on node 14.15.1 :
sfdx force:data:soql:query -q "SELECT Id FROM Pricebook2 WHERE IsStandard = true" -r csv ✘ 130 cmtd-enhanced-list ⬆ ✱
ERROR running force:data:soql:query: Cannot find module 'antlr4/index'
Require stack:
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/gen/SOQLLexer.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/dist/lib/data/soqlParser/index.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/dist/lib/data/dataSoqlQueryCommand.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/dist/commands/force/data/soql/query.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/@oclif/config/lib/plugin.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/@oclif/config/lib/config.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/@oclif/config/lib/index.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/command.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/index.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/dist/cli.js
- /home/esya/.nvm/versions/node/v14.15.1/lib/node_modules/sfdx-cli/bin/run
@Esya this part is already described in #747
Any plugins that depend on salesforce-alm is also broken during sfdx plugins: install, preresolution using yarn doesn't seem to have any effect, any ideas?
Getting folks to update to node14 on various ci/cd images seem to be really difficult
On my side I found a few ways to workaround
- forcing the cli version to install to latest working 7.70.1
- using yarn and installing globally sfdx-cli, I added a quick thing in it's package.json
"resolutions": {"antlr4": "<=4.8.0"}- using npm and installing locally (not tested as I usually prefer installing sfdx-cli globally) with a npm-shrinkwrap.json file having something like
{"lockfileVersion":1,"dependencies":{"antlr4":{"version":"~4.8.0","from":"antlr4@^4.7.2"}}}
@azlam-abdulsalam that's the most generic solution I found. Just didn't test how to implement in CI toolchain. The "resolution" with yarn is elegant.
I just discovered a easier method to globally install that works both for npm and yarn
- if you have sfdx-cli, remove/unstall it
npm -g uninstall sfdx-clioryarn global remove sfdx-cli- force install globally an acceptable version of antlr4
npm -g i [email protected]oryarn global add [email protected]- install your sfdx-ci
npm -g i sfdx-clioryarn global add sfdx-cli(beauty of dependency algorithms, they will find a globally installed version "4.8.0" compatible with the asked version in dependency tree "^4.7.2")Makes it all working (even the SOQL queries that crash in nodeJS14 with [email protected]) and easier than any other workaround I found for the meantime
@KevinGossentCap - Thank you sharing this. For the second option, did you manually modify the package.json for the global install of sfdx-cli? Can you recall what were the exact steps? I want to give it a go in our CI installation.
@saurabh-deep unfortunately, my easier methods only worked on my local windows computer.
I tested the yarn one on a Jenkins CI and it failed even though I can't understand why the behavior is different
@KevinGossentCap - I see. Thank you!
We'll release an update that pins to a working version of antlr (in the short term) and work on removing the dependency entirely in the longer term. Their response is disappointing. Apologies for disruption!
@shetzel deeply hoping for this week 🙏
Thanks a lot.
Resolution available with TAG latest-rc.
to use starting today : 'yarn global add sfdx-cli@latest-rc' or 'npm -g i sfdx-cli@latest-rc'
From usual sfdx-cli release management, it should also be in "normal" latest version starting Friday morning (Thursday late at night) European time
Thanks a lot.
Resolution available with TAG latest-rc.
to use starting today : 'yarn global add sfdx-cli@latest-rc' or 'npm -g i sfdx-cli@latest-rc'
From usual sfdx-cli release management, it should also be in "normal" latest version starting Friday morning (Thursday late at night) European time
This is great news @KevinGossentCap! Thank you for sharing this with us.
Thank you very much @KevinGossentCap, just tested 2min ago and indeed, it works !
@KevinGossentCap - thank you! The antrl lib has been removed in latest-rc and will be in latest this Thursday morning (PST).
Most helpful comment
Thanks a lot.
Resolution available with TAG latest-rc.
to use starting today : 'yarn global add sfdx-cli@latest-rc' or 'npm -g i sfdx-cli@latest-rc'
From usual sfdx-cli release management, it should also be in "normal" latest version starting Friday morning (Thursday late at night) European time