function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Srinivas NimmagaddaSrinivas Nimmagadda 

Error : " Installing plugin @salesforce/lwc-dev-server... ! " when installing in my Visual Studio in Windows

I was trying to install the local Dev Server and when I execute this command it is throwing an error.
 
C:\Users\Desktop\Salesforce> sfdx plugins:install @salesforce/lwc-dev-server

This plugin is not digitally signed and its authenticity cannot be verified. Continue installation y/n?: y
Finished digital signature check.
error An unexpected error occurred: "https://registry.yarnpkg.com/@salesforce%2flwc-dev-server: self signed certificate in certificate chain".
Installing plugin @salesforce/lwc-dev-server... !
Error: yarn add @salesforce/lwc-dev-server@latest --non-interactive --mutex=file:C:/Users/p2764490/AppData/Local/sfdx/yarn.lock --preferred-cache-folder=C:/Users/p2764490/AppData/Local/sfdx/yarn --check-files exited with code 
1
    at ChildProcess.<anonymous> (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/plugin-plugins/lib/yarn.js:31:28)

 
AnudeepAnudeep (Salesforce Developers) 
Although the error message is slightly different, I guess it is similar to the issue reported here

You can try the fix based on official DX doc:

Create a plugin whitelist file named unsignedPluginWhiteList.json in the config directory with the following content:
 
[ "salesforcedx" ]

Move the whitelist file in a specific directory before running the plugin install command:
 
mv config/unsignedPluginWhiteList.json $HOME/.config/sfdx/.


 
afsal rashiq36afsal rashiq36
@srinivas did u got any solution?
 
Vijay KenchuVijay Kenchu
@afsal, did you get it installed as I am also facing the same issue?
Vijay KenchuVijay Kenchu
I got it resolvd this issue. Here is what it worked for me:
1. Installation of Nodejs software and disconnect from office network VPN (if connected).
2. >Install node gyp by running 
      npm install -g node-gyp
    >In command prompt or whatever command-line interface you use.
3. And then after that, you can run 
     npm install --global --production windows-build-tools
4. And finally tried the below command it worked after 2 3 times..
     sfdx plugins:install @salesforce/lwc-dev-server
 
Khan Mohammed 7Khan Mohammed 7
Hi Vijay,

Thank you...! it's working
very clear steps
Sajid Hussain 15Sajid Hussain 15
@vijay kenchu
I got it resolvd this issue. Here is what it worked for me:
1. Installation of Nodejs software and disconnect from office network VPN (if connected).
2. >Install node gyp by running 
      npm install -g node-gyp
    >In command prompt or whatever command-line interface you use.
3. And then after that, you can run 
     npm install --global --production windows-build-tools
4. And finally tried the below command it worked after 2 3 times..
     sfdx plugins:install @salesforce/lwc-dev-server


its really work in my mac.
Alex TsAlex Ts
Worked also for me except step 3 - you dont need to install windows-build-tools. Since you try to install it without admin rights it falls out with installation errors, despite this after node-gyp installation your dev server package will be successfully installed. 
Richika LWCRichika LWC
Mine is not working after applying all the steps above. Is there any other way to fix this issue.
MOHANA PRIYA RMOHANA PRIYA R
Mine is not working too. Facing the below error even after trying the above mentioned steps.
Kindly help

Installing plugin @salesforce/lwc-dev-server... failed
    Error: yarn add @salesforce/lwc-dev-server@latest --non-interactive --mutex=file:C:\Users\Prashanth
    R\AppData\Local\sfdx\yarn.lock --preferred-cache-folder=C:\Users\Prashanth R\AppData\Local\sfdx\yarn --check-files
     exited with code 1
Rahul Gawale 26Rahul Gawale 26
Run `sfdx update` 
then install. it worked for me!
Rahul Gawale 26Rahul Gawale 26
also, make sure you run
npm install -g node-gyp

 
SWATHI B VSWATHI B V
I was able to fix this using:https://github.com/nodejs/node-gyp
  • run  'npm install -g node-gyp' in command prompt
  • Install the current version of Python from the Microsoft Store package(I installed 3.10.8 from https://www.python.org/downloads/release/python-3108/)
  • Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio Community (using the "Desktop development with C++" workload)
  • Launch cmd, npm config set msvs_version 2017
  • now try to run ' sfdx plugins:install @salesforce/lwc-dev-server'
Hope this helps
Prabhu@ConcloPrabhu@Conclo
I faced the same issue, not sure if you guys were able to solve this. I ran the below command in mac terminal and then tried installing lwc local  dev server and it workd for me. Hope this helps

sudo npm install -g node-gyp
and then 
sfdx plugins:install @salesforce/lwc-dev-server
test Emp Name572test Emp Name572
if You have Mac Os - install - Command Line Tools for Xcode