4

I am trying to create Lightning web component and keep getting this message, but could not figure out the issue. What does it say?

Starting SFDX: Create Lightning Web Component

23:59:38.741 sfdx force:lightning:component:create --type lwc --componentname firstwebcomponent --outputdir force-app\main\default\lwc
 !    !   Lightning bundles must have a parent folder named
 !    'lightningcomponents'.
23:59:50.333 sfdx force:lightning:component:create --type lwc --componentname firstwebcomponent --outputdir force-app\main\default\lwc ended with exit code 1

enter image description here

3
  • What is your cli version ? Run sfdx plugins in your terminal Commented Dec 27, 2018 at 19:04
  • And you need pre release version of the plug-in for it Commented Dec 27, 2018 at 19:04
  • @MohithShrivastava Thanks it works after updating the version. Commented Dec 27, 2018 at 19:28

2 Answers 2

11

Lets understand how the vscode extension for lwc works . Vscode extension invokes the CLI commands that the salesforcedx cli plugin provides .

In pilot release lwc folder was named as lightningwebcomponent and not lwc and hence prior cli version still use the same old reference .

Get the pre-release cli plugin by running sfdx plugins:install salesforcedx@pre-release

and when you run sfdx plugins you will see v45.0.xx if you have the latest cli .Now when you try creating an lwc component you should be fine .

2
  • 1
    Your answer explains the exact reason behind my problem. Commented Dec 27, 2018 at 19:30
  • Thanks @MohithShrivastava. :) This works.
    – Sree
    Commented Aug 21, 2019 at 3:10
1

From below link

https://success.salesforce.com/answers?id=9063A000000Dz9xQAC

Please execute the below commands: -

1 - sfdx plugins --core

2 - sfdx plugins:install salesforcedx@pre-release

3 - again execute sfdx plugins --core

For more information see the below video

https://www.youtube.com/watch?v=dcRM7Mq541Y&t=1798s

2
  • Can you explain further? It is not clear to me. I have not created LWC yet. while trying to create, I am getting that message. I am adding a screenshot for more information. Commented Dec 27, 2018 at 18:48
  • @sfdc Please correct the typo. It should be "install" for point 2. Commented Mar 4, 2020 at 3:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .