You need to sign in to do that
Don't have an account?
Devon Morancie
"Unrecognized flag" error
Hello, I am getting the following error in VS Code when trying to create a new project. I started doing Lightning Web Components, and since installing the Salesforce CLI and updating all of the downloads to the latest version, it has broken and I get this error whenever creating a new project, either for LWC or regular Lightning. I cannot find any documentation or support for this.
13:47:59.641 sfdx force:project:create --projectname HellowWorldLightningComponent --outputdir c:\Users\Devon Morancie\Documents\Projects --template standard
Error: Unrecognized flag: {"name":"projectname","char":"n","required":true,"description":"name of the generated project","longDescription":"The name for the new project. Any valid folder name is accepted.","type":"string","values":[]}
at flags.forEach.flag (C:/Program Files/Salesforce CLI/client/node_modules/force-language-services/dist/common/main/LegacyCommand.js:77:31)
at Array.forEach (<anonymous>)
at Function.toFlagsConfig (C:/Program Files/Salesforce CLI/client/node_modules/force-language-services/dist/common/main/LegacyCommand.js:28:19)
at Object.<anonymous> (C:/Program Files/Salesforce CLI/client/node_modules/force-language-services/dist/oclif/force/project/create.js:31:66)
at Module._compile (C:/Program Files/Salesforce CLI/client/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
at LazyLoader.loadModule (C:/Program Files/Salesforce CLI/client/node_modules/@salesforce/lazy-require/lib/LazyLoader.js:139:21)
at Function._load (C:/Program Files/Salesforce CLI/client/node_modules/@salesforce/lazy-require/lib/LazyLoader.js:115:29)
at require (C:/Program Files/Salesforce CLI/client/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at fetch (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:101:21)
at Plugin.findCommand (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:115:21)
at Object.load (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:48:72)
13:48:02.587 sfdx force:project:create --projectname HellowWorldLightningComponent --outputdir c:\Users\Devon Morancie\Documents\Projects --template standard ended with exit code 1
13:47:59.641 sfdx force:project:create --projectname HellowWorldLightningComponent --outputdir c:\Users\Devon Morancie\Documents\Projects --template standard
Error: Unrecognized flag: {"name":"projectname","char":"n","required":true,"description":"name of the generated project","longDescription":"The name for the new project. Any valid folder name is accepted.","type":"string","values":[]}
at flags.forEach.flag (C:/Program Files/Salesforce CLI/client/node_modules/force-language-services/dist/common/main/LegacyCommand.js:77:31)
at Array.forEach (<anonymous>)
at Function.toFlagsConfig (C:/Program Files/Salesforce CLI/client/node_modules/force-language-services/dist/common/main/LegacyCommand.js:28:19)
at Object.<anonymous> (C:/Program Files/Salesforce CLI/client/node_modules/force-language-services/dist/oclif/force/project/create.js:31:66)
at Module._compile (C:/Program Files/Salesforce CLI/client/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
at LazyLoader.loadModule (C:/Program Files/Salesforce CLI/client/node_modules/@salesforce/lazy-require/lib/LazyLoader.js:139:21)
at Function._load (C:/Program Files/Salesforce CLI/client/node_modules/@salesforce/lazy-require/lib/LazyLoader.js:115:29)
at require (C:/Program Files/Salesforce CLI/client/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at fetch (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:101:21)
at Plugin.findCommand (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:115:21)
at Object.load (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:48:72)
13:48:02.587 sfdx force:project:create --projectname HellowWorldLightningComponent --outputdir c:\Users\Devon Morancie\Documents\Projects --template standard ended with exit code 1
Greetings to you!
This might be because you have some old versioned product installed in your system.
Try to update Salesforce CLI using below command:
sfdx update
Uninstall the "Salesforce Extensions Pack" in VSCode and re-install the extension. Also, make sure the environment variable is also updated with the path of CLI and VSCode.
If the problem persists, delete all the references to the CLI and install it again.
Delete all the references to the CLI with the following commands:
sudo rm -rf /usr/local/sfdx
sudo rm -rf /usr/local/lib/sfdx
sudo rm -rf /usr/local/bin/sfdx
sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx
sudo rm -rf ~/Library/Caches/sfdx
And then install it again:
https://developer.salesforce.com/tools/sfdxcli
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Hi thanks for the reply, I have done all of those things several times. Everything is up to date, running the latest versions, fully clean installations several times. Still getting the same error. It is also not letting me create projects with manifests either.