Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sfdx command not working after installing salesforce CLI

I installed salesforce cli and when I run the sfdx command on the command window, I am getting this error:

PS C:\\Users\\as67934\> sfdx
node:internal/modules/cjs/loader:1247
throw err;
^\

    Error: Cannot find module 'C:\Users\as67934\undefined'
    at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15)
    at Function._load (node:internal/modules/cjs/loader:1070:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Function.executeUserEntryPoint [as runMain]     (node:internal/modules/run_main:170:5)
    at node:internal/main/run_main_module:36:49 {

code: 'MODULE_NOT_FOUND',
requireStack: \[\]
}\

I tried reinstalling salesforce cli and VS Code still getting the same error. Do we need node.js to be installed for this?

Installed Salesforce CLI

like image 219
AMS Avatar asked Aug 13 '26 05:08

AMS


1 Answers

Even I faced the same problem a few hours ago.
Got to know the sdfx command is old and not supported in certain OS.
Try using sf instead.
Worked for me!

like image 60
Jibesh04 Avatar answered Aug 16 '26 19:08

Jibesh04