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

New sfdx version 7.173 with npm does not work - Error: Cannot find module 'node:os' #1768

Closed
JuliWaver opened this issue Oct 24, 2022 · 3 comments
Labels
investigating We're actively investigating this issue

Comments

@JuliWaver
Copy link

Summary

I got some API version error therefore I updated my sfdx version with command: npm update --global sfdx-cli like in the past. Afterwards nothing is working anymore. I can't run any sfdx command withou getting an error message.

Steps To Reproduce:

Update your sfdx version to the latest version with command "npm update --global sfdx-cli" and try to use any sfdx command afterwards (e.g. sfdx version, sfdx force:org:list, ...)

Expected result

Normally the command should work, no error message shown.

Actual result

Error message is shown:

PS C:\XXX> sfdx --version
internal/modules/cjs/loader.js:905
throw err;
^

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

  • C:\Users\XYZ\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules@oclif\plugin-version\lib\commands\version.js
  • C:\Users\XYZ\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules@oclif\plugin-version\lib\index.js
  • C:\Users\XYZ\AppData\Roaming\npm\node_modules\sfdx-cli\dist\cli.js
  • C:\Users\XYZ\AppData\Roaming\npm\node_modules\sfdx-cli\bin\run
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Object. (C:\Users\XYZ\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:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\XYZ\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\plugin-version\lib\commands\version.js',
    'C:\Users\XYZ\AppData\Roaming\npm\node_modules\sfdx-cli\node_modules\@oclif\plugin-version\lib\index.js',
    'C:\Users\XYZ\AppData\Roaming\npm\node_modules\sfdx-cli\dist\cli.js',
    ]
    }

System Information

  • Terminal: Visual Studio Code embedded Terminal (Powershell)
  • npm version: 8.19.2
  • node.js version: v14.17.3
  • sfdx version: sfdx-cli@7.173.0
@JuliWaver JuliWaver added the investigating We're actively investigating this issue label Oct 24, 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.

@cristiand391
Copy link
Member

This is an issue with the node version you have installed, make sure to always use the latest LTS version available, see:

#1728

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

JuliWaver commented Oct 25, 2022

Perfect, thank you so much @cristiand391. I was not able to find the related issue #1728 before. With the new version of node.js v16.18.0 it is working for me :)

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