node:internal/modules/cjs/loader:1386
throw err;
^
at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
at Function._load (node:internal/modules/cjs/loader:1192:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v22.19.0
PS
> sfdx
node:internal/modules/cjs/loader:1386
throw err;
^
at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
at Function._load (node:internal/modules/cjs/loader:1192:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v22.19.0
PS
> sf
The Salesforce CLI
VERSION
@salesforce/cli/2.109.6 win32-x64 node-v22.19.0
USAGE
$ sf [COMMAND]
TOPICS
agent Commands to work with agents.
alias Use the alias commands to manage your aliases.
analytics Work with analytics assets.
apex Use the apex commands to create Apex classes, execute
anonymous blocks, view your logs, run Apex tests, and view
Apex test results.
api Commands to interact with API calls.
cmdt Generate a field for a custom metadata type based on the
provided field type.
code-analyzer Output the current state of configuration for Code Analyzer.
community Create an Experience Cloud site using a template.
config Commands to configure Salesforce CLI.
data Manage records in your org.
dev Audit messages in a plugin's messages directory to locate
unused messages and missing messages that have references in
source code.
flow Display test results for a specific asynchronous test run.
force Legacy commands for backward compatibility.
info Access Salesforce CLI information from the command line.
lightning Work with Lightning Web and Aura components.
logic Use the logic commands to run Apex and Flow tests and view
the test results.
org Commands to create and manage orgs and scratch org users.
package Commands to develop and install unlocked packages and managed 2GP packages.
package1 Commands to develop first-generation managed and unmanaged
packages.
plugins list installed plugins
project Work with projects, such as deploy and retrieve metadata.
schema Generate metadata files.
sobject Commands to interact with Salesforce objects.
static-resource Work with static resources.
update update the sf CLI
version
COMMANDS
autocomplete Display autocomplete installation instructions.
commands List all sf commands.
doctor Gather CLI configuration data and run diagnostic tests to
discover and report potential problems in your environment.
help Display help for sf.
plugins List installed plugins.
search Search for a command.
update update the sf CLI
version
whatsnew Display Salesforce CLI release notes on the command line.
which Show which plugin a command is in.
PS
> sfdx
node:internal/modules/cjs/loader:1386
throw err;
^
Error: Cannot find module '
at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
at Function._load (node:internal/modules/cjs/loader:1192:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v22.19.0
After install the salsforce cli I got this error on vs code terminal
#Trailhead Challenges
Manish Kumar Yadav (Hitachi Energy) Forum Ambassador
Above error is valid because you are running sfdx which is depricated,
You should run only sf beacuse Salesforce has deprecated the old sfdx CLI in favor of sf.sf --version
Thanks,
Manish Kumar Yadav
Trailblazer Community Forum Ambassadors