+ Start a Discussion
Iago SilvaIago Silva 

Local Development Server for Lightning Web Components

I'm trying to set a Local Development Server for Lightning Web Components according to this link but when I try to install the plugin @salesforce/lwc-dev-server I get this error message :
Code: ShellParseError

and a .js file named npm-cli.js opens in my editor with this content:
#!/usr/bin/env node 
require('../lib/cli.js')(process)

Anyone knows what to do? Thanks in advance.
Best Answer chosen by Iago Silva
Keegan McCormack 1Keegan McCormack 1
Iago, I had the exact same issue and actually resolved with just updating then trying again, i.e.
sfdx update
sfdx plugins:install @salesforce/lwc-dev-server
After update got a more meaningful error (dependency missing 'node-gyp not found! Please ensure node-gyp is in your PATH--'). Which was resolved with just installing it
npm install -g node-gyp

 

All Answers

AbhinavAbhinav (Salesforce Developers) 
Check this:

https://developer.salesforce.com/tools/vscode/en/localdev/set-up-lwc-local-dev

Troubleshooting Tip: Due to a known issue, it’s likely you’ll see several errors when you install the plug-in. Run sfdx plugins --core to see if the plug-in is installed. If yes, try to start the Local Development server. If successful, you’re good to proceed.

You can follow below video link as well to set up.

https://www.youtube.com/watch?v=8eRFE4t2VyU

Thanks!
Iago SilvaIago Silva
Hi Abhinav,

I run sfdx plugins --core and the lwc-dev-server plugin is not installed. I also followed the instructions shown in the video you mentioned but didn't work. It gives the same error when trying to install the plugin.
denisse Solisdenisse Solis
Yes you are right (https://getforfashion.com/best-skin-tightening-food-complete-guide/) and cleared the ambiguities
Keegan McCormack 1Keegan McCormack 1
Iago, I had the exact same issue and actually resolved with just updating then trying again, i.e.
sfdx update
sfdx plugins:install @salesforce/lwc-dev-server
After update got a more meaningful error (dependency missing 'node-gyp not found! Please ensure node-gyp is in your PATH--'). Which was resolved with just installing it
npm install -g node-gyp

 
This was selected as the best answer
Iago SilvaIago Silva
Hi Keegan, thank you for you response.

I run
sfdx update
sfdx plugins:install @salesforce/lwc-dev-server

and now I have the following error:
 
Installing plugin @salesforce/lwc-dev-server... failed
    Error: yarn add @salesforce/lwc-dev-server@latest --non-interactive --mutex=file:C:\Users\Nescara\AppData\Local\sfdx\yarn.lock 
    --preferred-cache-folder=C:\Users\Nescara\AppData\Local\sfdx\yarn --check-files exited with code 1
Iago SilvaIago Silva
Hi Keegan, Denisse and Abhinav

I don't know how but now I'm able to use local lwc development. I just tried again these days and now it works. Even so, thank you for your answers.
Kabi JurikKabi Jurik
Hello! Trying to work among the distractions of everyday life at home. Screaming children, begging for attention, household chores, or noisy neighbors all make it difficult to separate work from personal affairs. You can find more about it here https://www.helpware.com/blog/creating-company-culture-within-remote-teams really a lot of useful information