1

All was working fine till the morning untill, in the afternoon when i tried to run some create LWC commands. Now, no SFDX commands will work, i am getting the following error :

04:30:38.633 sfdx force:lightning:component:create --componentname myComponent2 --outputdir force-app/main/default/aura
ERROR running force:lightning:component:create:  Command failed with ENOENT: npm root -g --prefix /Users/padmajasubhash/Documents/SFDX Projects/Surya Practice/.yo-repository --loglevel error
spawnSync npm ENOENT
04:30:39.881 sfdx force:lightning:component:create --componentname myComponent2 --outputdir force-app/main/default/aura
 ended with exit code 1

Please help.

6
  • Could you run sfdx update to see if it fixes this. Commented May 4, 2020 at 3:58
  • Try restarting your computer. That tends to fix this error.
    – sfdcfox
    Commented May 4, 2020 at 4:24
  • @sfdcfox : Tried that, still not working. Commented May 4, 2020 at 5:32
  • @MohithShrivastava : Already upto date Commented May 4, 2020 at 5:33
  • It seems like the project wasn't generated properly. Try creating an empty .yo-repository folder in /Users/padmajasubhash/Documents/SFDX Projects/Surya Practice. That might fix it, though it doesn't fix the initial problem
    – nchursin
    Commented May 4, 2020 at 7:37

1 Answer 1

5

Please visit- https://nodejs.org/en/download/ and install node.js on your machine. This is not a vs code extension. Restart VS code after install.

1
  • Yup, don't know why but this started working fine after i installed node js. It used to work fine before. Well, anyway, it works now. Commented May 22, 2020 at 9:57

You must log in to answer this question.

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