You need to sign in to do that
Don't have an account?

error in creating new project in visual studio code for LWC CLI
I have followed steps in below trailhead:
https://trailhead.salesforce.com/en/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component?trail_id=build-lightning-web-components
installed CLI and VS Code but facing issue when i am trying to create new project as below:

https://trailhead.salesforce.com/en/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component?trail_id=build-lightning-web-components
installed CLI and VS Code but facing issue when i am trying to create new project as below:
Greetings to you!
SFDX must be in your PATH environment variable. The full path of the bin subdirectory where the SFDX executable lives. You'll likely need to relaunch your Visual Studio Code to get them to observe any changes you've made to your Windows PATH. Try closing out the VS Code or terminal and reopening a new one.
1. Verify the "Salesforce CLI" installed successfully or not
Go to → C:\Program Files\Salesforce CLI\bin → Verify sfdx.exe should be available.
2. Add this path to environment variables "Path" Go To → Windows Search → Edit environment variables for your account
PATH value should be (depends on your OS and directory): "C:\Program Files\Salesforce CLI\bin";"C:\Users\Consultant\AppData\Local\Programs\Microsoft VS Code\bin";
Reference: https://salesforce.stackexchange.com/questions/163795/sfdx-is-not-recognized-as-an-internal-or-external-command
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
may i know what is path vairables ? I am not able to understand from where i can find it
The PATH is the system variable that your operating system uses to locate needed executables from the command line or Terminal window.
Please refer to the below links which might help you further.
https://www.java.com/en/download/help/path.xml
Regards,
Khan Anas
I hope you are doing well but make sure you followed these steps:
- Installed VS code with CLI
- Open the Command Palette by pressing Ctrl+Shift+P, If you are using Windows or Cmd+Shift+P on macOS
- Type and select SFDX: Create Project
- Enter your project name
- Create a new folder or Select a folder to store the project
- Make sure after creating a project you have to authorize your org to type "SFDX: Authorize an Org"
- You have to give credential for login, after completing this process you are able to create LWC project in VS code
For Create LWC Project you have to follow this command
- In Visual Studio code, open the Command Palette by pressing Ctrl+Shift+P on Windows or Cmd+Shift+P on macOS
- Type or Select SFDX: Create Lightning Web Component
- Press Enter to accept the default force-app/main/default/lwc
- Enter your project name
- Press Enter
- Now you can check one project will be active inside LWC folder in vs code
You can follow this link for more help:
https://www.youtube.com/watch?v=V_riFQU5iNA
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi