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

Error in sf package install (ERR_REQUIRE_ESM) #3144

Closed
christopher-scott-ca opened this issue Dec 10, 2024 · 3 comments
Closed

Error in sf package install (ERR_REQUIRE_ESM) #3144

christopher-scott-ca opened this issue Dec 10, 2024 · 3 comments
Labels
more information required Issue requires more information or a response from the customer validated Version information for this issue has been validated

Comments

@christopher-scott-ca
Copy link

christopher-scott-ca commented Dec 10, 2024

Steps

  1. Start from new project
sf project generate --name test
  1. Create a scratch org
sf org create scratch --target-dev-hub DevHubAlias --definition-file config/project-scratch-def.json --alias my-test-org
  1. Install FS Package
sf package install --package 04t3y00000233sAAAQ -w 15 --target-org my-test-org

Expected result

package should install

Actual result

(node:23692) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
Error (ERR_REQUIRE_ESM): require() of ES Module C:\Program Files\sf\client\node_modules\strip-ansi\node_modules\ansi-regex\index.js from C:\Program Files\sf\client\node_modules\strip-ansi\index.js not supported.
Instead change the require of C:\Program Files\sf\client\node_modules\strip-ansi\node_modules\ansi-regex\index.js in C:\Program Files\sf\client\node_modules\strip-ansi\index.js to a dynamic import() which is available in all CommonJS modules.

Additional information

System Information

CLI:
@salesforce/cli/2.68.6 win32-x64 node-v22.11.0

Plugin Version:
@oclif/plugin-autocomplete 3.2.10 (core)
@oclif/plugin-commands 4.1.10 (core)
@oclif/plugin-help 6.2.18 (core)
@oclif/plugin-not-found 3.2.28 (core)
@oclif/plugin-plugins 5.4.17 (core)
@oclif/plugin-search 1.2.16 (core)
@oclif/plugin-update 4.6.13 (core)
@oclif/plugin-version 2.2.16 (core)
@oclif/plugin-warn-if-update-available 3.1.23 (core)
@oclif/plugin-which 3.2.19 (core)
@salesforce/cli 2.68.6 (core)
apex 3.6.3 (core)
api 1.3.2 (core)
auth 3.6.75 (core)
data 3.11.4 (core)
deploy-retrieve 3.15.13 (core)
info 3.4.21 (core)
limits 3.3.40 (core)
marketplace 1.3.6 (core)
org 5.2.4 (core)
packaging 2.9.3 (core)
schema 3.3.42 (core)
settings 2.4.6 (core)
sobject 1.4.46 (core)
telemetry 3.6.23 (core)
templates 56.3.30 (core)
trust 3.7.43 (core)
user 3.6.3 (core)
SF ENV. VARS.
SF_AUTOUPDATE_DISABLE,true
SF_BINPATH,C:\Program Files\sf\bin\\sf.cmd
SF_DISABLE_AUTOUPDATE,true
SF_UPDATE_INSTRUCTIONS,Use "npm update --global @salesforce/cli" to update npm-based installations.
Windows: true
Shell: powershell
Channel: stable

Diagnostics

✅ pass - salesforcedx plugin isn’t installed
✅ pass - you don't have any linked plugins
✅ pass - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/
✅ pass - using latest or latest-rc CLI version
✅ pass - can access: https://test.salesforce.com
✅ pass - can access: https://appexchange.salesforce.com/services/data
✅ pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
✅ pass - [@salesforce/plugin-auth] CLI supports v2 crypto
✅ pass - [@salesforce/plugin-auth] CLI using stable v1 crypto

@mdonnalley
Copy link
Contributor

@christopher-scott-ca does that error only occur when running sf package install --package 04t3y00000233sAAAQ -w 15 --target-org my-test-org? or is it on every command?

Either way, I would first try doing a complete uninstall of the CLI and then reinstall: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_uninstall.htm

@mdonnalley mdonnalley added the more information required Issue requires more information or a response from the customer label Dec 10, 2024
@christopher-scott-ca
Copy link
Author

christopher-scott-ca commented Dec 10, 2024

The scratch org created just fine so other commands work. But I do get the following error when running sf update

sf update

SyntaxError: The requested module '@inquirer/type' does not provide an export named 'CancelablePromise'

I got the reported error on an older version 2.65.X I think, then I updated the CLI by downloading the installation exe and running it. I will try a complete uninstall/reinstall and let you know.

@github-actions github-actions bot added validated Version information for this issue has been validated investigating We're actively investigating this issue and removed more information required Issue requires more information or a response from the customer labels Dec 10, 2024
@mdonnalley mdonnalley added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Dec 10, 2024
@christopher-scott-ca
Copy link
Author

Update: A complete uninstall and reinstall resolved my issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more information required Issue requires more information or a response from the customer validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

2 participants