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

Any sfdx command fails after npm update #1728

Closed
Kruckemeyer opened this issue Sep 28, 2022 · 3 comments
Closed

Any sfdx command fails after npm update #1728

Kruckemeyer opened this issue Sep 28, 2022 · 3 comments
Labels
investigating We're actively investigating this issue

Comments

@Kruckemeyer
Copy link

Summary

After installing the latest version of the sfdx-cli from npm, any sfdx command is going to fail with the same error message. After this happened on two different machines with the same pattern I thought it might be an issue.

Steps To Reproduce:

npm install -g sfdx-cli
sfdx --version

Expected result

$ sfdx --version
sfdx-cli/7.169.1 win32-x64 node-v14.17.0

Actual result

$ sfdx --version
internal/modules/cjs/loader.js:888
throw err;
^

Error: Cannot find module 'node:os'
Require stack:

  • C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules@oclif\plugin-version\lib\commands\version.js
  • C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules@oclif\plugin-version\lib\index.js
  • C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\dist\cli.js
  • C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\bin\run
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules@oclif\plugin-version\lib\commands\version.js:4:19)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Module.require (internal/modules/cjs/loader.js:957:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\plugin-version\lib\commands\version.js',
    'C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\plugin-version\lib\index.js',
    'C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\dist\cli.js',
    'C:\Users\user\AppData\Roaming\npm\node_modules\sfdx-cli\bin\run'
    ]
    }

System Information

  • Which shell/terminal are you using?
    bash

  • If you are using sfdx

    • Run sfdx version --verbose --json --> fails
      same output like in the actual result
  • If you are using sf

    • Run sf version --verbose --json --> works
      $ sf version --verbose --json
      @salesforce/cli/1.9.1 win32-x64 node-v14.17.0
@Kruckemeyer Kruckemeyer added the investigating We're actively investigating this issue label Sep 28, 2022
@github-actions
Copy link

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.

@Kruckemeyer Kruckemeyer changed the title Any command fails after npm update Any sfdx command fails after npm update Sep 28, 2022
@cristiand391
Copy link
Member

cristiand391 commented Sep 28, 2022

Hey @Kruckemeyer 👋🏼

This is a node issue, fixed in v14.18.0. if you update to the latest v14 release sfdx should work again.

See node release notes: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V14.md#2021-09-28-version-14180-fermium-lts-targos

[f9f9389d83] - (SEMVER-MINOR) module: add support for node:‑prefixed require(…) calls (ExE Boss) nodejs/node#37246

@Kruckemeyer
Copy link
Author

Hey @cristiand391,
thanks for your super fast reply. sfdx is running fine with a newer nodejs version.

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

2 participants