function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ross McLeod 3Ross McLeod 3 

Salesforce CLI Error Creating Lightning Component

Hi All

I've got an issue with Visual Studio Code and using the Salesforce CLI. Up until this weekend all was working fine, I could hapily create lightning component and deploy them to my org.

However without me having changed anything I am now getting the below error when adding a new lightining component:
Starting SFDX: Create Lightning Component

07:40:42.424 sfdx force:lightning:component:create --componentname EtwCandidateRequirement --outputdir force-app\main\default\aura
(node:2068) [UnknownConfigKey Plugin: sfdx-cli] UnknownConfigKey Plugin: sfdx-cli: Unknown config key: disableTelemetry
module: @oclif/config@1.15.1
task: runHook prerun
plugin: sfdx-cli
root: C:\Program Files\Salesforce CLI\client
See more details with DEBUG=*
ERROR running force:lightning:component:create:  Command failed with exit code 1: npm root -g --prefix c:\Repository\Org Explorer\.yo-repository --loglevel error
'npm' is not recognized as an internal or external command,
operable program or batch file.
07:40:44.269 sfdx force:lightning:component:create --componentname EtwCandidateRequirement --outputdir force-app\main\default\aura
 ended with exit code 1

I have tried uninstalling and re-installing the CLI which hasn't resolved the issue. 

Has anyone else had this issue?

Thanks
 

Ross

Best Answer chosen by Ross McLeod 3
SwethaSwetha (Salesforce Developers) 
HI Ross,
As per https://salesforce.stackexchange.com/questions/304554/npm-is-not-recognized-as-an-internal-or-external-command-vs-code-salesforc this appears to be an issue many users reported after having Salesforce CLI updated to the latest version "sfdx-cli/7.56.1-2773b53bf5"

So the solution would be to either install the NPM package manager or install nodejs.

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
Thanks

All Answers

SwethaSwetha (Salesforce Developers) 
HI Ross,
As per https://salesforce.stackexchange.com/questions/304554/npm-is-not-recognized-as-an-internal-or-external-command-vs-code-salesforc this appears to be an issue many users reported after having Salesforce CLI updated to the latest version "sfdx-cli/7.56.1-2773b53bf5"

So the solution would be to either install the NPM package manager or install nodejs.

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
Thanks
This was selected as the best answer
Ross McLeod 3Ross McLeod 3
Hi

Thanks very much, installing Node JS worked a treat.