You need to sign in to do that
Don't have an account?
David Man Phan
I finally got @salesforce/lwc-dev-server installed successfully after months of trying
Before I forget these were the exact steps I took to finally make it work.
CLEAN UP
Several repeat steps were needed
Step1: sfdx plugins:install @salesforce/lwc-dev-server
CLEAN UP
- Clean up your current installations:
- Delete Folders .sf and .sfdx and local installation
- Uninstall all your previous versions of node and python
- Make sure you have Python 3 installed
- During NPM Install of Plugin, it will look for a version of Python installed, else it will fail
- Install NodeJS LTS 18
- Install Node-Gyp using NPM Install command (NPM comes with NodeJS)
- Otherwise, the NPM installation of the Plugin will automatically install NODE-GYP for you
- Install SF CLI using NPM!!!!!! not the stupid Windows MSI Installer
- https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_npm
- NPM is a two step process
- Install .sfdx
- Install .sf
- After you have installed .sf and .sfdx (This will get you the latest version)
- AUTHENTICATE an ORG
- Test it by connecting to your Sandbox
- If you can't authenticate using standard web login try this
- sfdx force:auth:device:login --instanceurl <your custom or test.salesforce.com> --setdefaultusername
- This will display a user code within the cmd window
- Enter that Code after you open
- YOU MUST Enter the URL that you started with
- https://<The URL You specified above>/setup/connect in a browser
- If you can't authenticate using standard web login try this
Several repeat steps were needed
Step1: sfdx plugins:install @salesforce/lwc-dev-server
- This will fail with that stupid YARN Error Message
- This will properly install Node-Gyp for you
- It will also pass the python check sinced you installed it at the very beginning
- gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@18.16.0 | win32 | x64
gyp info find Python using Python version 3.11.3 found at "C:\Python311\python.exe" - But it will Burp about not having Visual Studio
- 7756 error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
7756 error gyp ERR! find VS looking for Visual Studio 2015
7756 error gyp ERR! find VS - not found
7756 error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
7756 error gyp ERR! find VS
7756 error gyp ERR! find VS **************************************************************
7756 error gyp ERR! find VS You need to install the latest version of Visual Studio
7756 error gyp ERR! find VS including the "Desktop development with C++" workload. - NO PROBLEM
- RUN npm install --global windows-build-tools
- This will also FAIL, but it downsloads the VS17 exe file for you
- This is saved in
- C:\Users\your name\.windows-build-tools\vs_BuildTools.exe
- Install it and MAKE SURE YOU Select
- VS including the "Desktop development with C++" workload.
- 7756 error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
- This time it will detect Python and the Version of Visual Studio 17
- It will load all the packages with no errors, but the plug in is still not installed
- you will see something like this
- added 1218 packages, and changed 1 package in 7m
102 packages are looking for funding - I ALMOST QUIT AT THIS POINT
- sfdx plugins:install @salesforce/lwc-dev-server
- GOSH DARN IT - IT FINALLY Installed
- @salesforce/lwc-dev-server... \ [2/4] Fetching packages...
warning "@salesforce/lwc-dev-server > @rollup/plugin-alias@3.1.9" has unmet peer dependency "rollup@^1.20.0||^2.0.0".
warning "@salesforce/lwc-dev-server > request-promise-native@1.0.9" has unmet peer dependency "request@^2.34".
warning "@salesforce/lwc-dev-server > request-promise-native > request-promise-core@1.1.4" has unmet peer dependency "reqInstalling plugin @salesforce/lwc-dev-server... installed v2.11.0
- @salesforce/lwc-dev-server... \ [2/4] Fetching packages...
In Summary
Python 3
Nodejs 18 LTS
Visual Studio 17 and Desktop Build
Multiple Plug-in Install steps
(See my step by step above)
Anyways, I HOPE THIS IS Useful, because I scoured the internet for answers. TRUST ME. All the answers had some truth, but none worked for me. UNTIL THIS DAY!!!!!
for the authentication
https://<your domain url>/setup/connect <-- is the full URL
I anctipated more road blocks and it was true
I am now having problems trying to view the components in preview mode. Even with a simple Hello component
Supposedly these are the steps you must take for it to work
Plugin Installed
Create a LWC Component in VS and it will create a project with proper SFDX json and folder structure
Authenticate an Org
This is your default ORG now
YOU DON'T NEED a DEV HUB OR A SCRATCH ORG. I recommend using a DEV sandbox if you work in a company otherwise request a developer sandbox from Trailheads.
This is your default ORG
Optimal Experiance
- With VS open
- Run this in your terminal
- sfdx force:lightning:lwc:start
- This just initiates the server in the background
- open localhost:3333 in your browser
- It's suppose to show all your comp0nents in your default ORG in a pretty page. NOT!!
Alternative Attemptmy answer in the question. guess nobody cares for the beta @salesforce/lwc-dev-server
it is a big headache and I still can't get my components to preview in the local server.
"WHOLLY MOLLY"
LWC Local Development Server is finally working!!!!
This time I tried setting it up on my Work PC
Followed pretty much the same steps but this timie I did something a little different
I installed NodeJS as a stand-alone, but when I installed VS 17 I also selected the NodeJS package as part of the installation
Not sure if that was the trick, but it works.
My Quest is done. I can actually start learning LWC development full-time.
game error fix(game news and error) (game error (https://itmtrav.com/))) how ?