1

I am trying to run LWC in local. I was able to install with errors

C:\WINDOWS\system32>sfdx plugins:install @salesforce/lwc-dev-server
Polling for new version(s) to become available on npm... done
Successfully validated digital signature for @salesforce/lwc-dev-server.
Finished digital signature check.
Installing plugin @salesforce/lwc-dev-server... - [2/4] Fetching packages...
warning "@salesforce/lwc-dev-server > [email protected]" has unmet peer dependency "request@^2.34".
warning "sfdx-plugin-source-read > @salesforce/command > @oclif/test > @oclif/core > [email protected]" has unmet peer dependency "@types/node@*".
warning "sfdx-plugin-source-read > @salesforce/command > @oclif/test > @oclif/core > [email protected]" has unmet peer dependency "typescript@>=2.7".
Installing plugin @salesforce/lwc-dev-server... - [4/4] Building fresh packages...
(node:14016) TypeError Plugin: @salesforce/lwc-dev-server: Cannot read properties of undefined (reading 'prototype')
module: @oclif/[email protected]
task: toCached
plugin: @salesforce/lwc-dev-server
root: C:\Users\xxxx\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server
See more details with DEBUG=*
Installing plugin @salesforce/lwc-dev-server... installed v2.11.0

while running I am getting following error.

C:\WINDOWS\system32>sfdx force:lightning:lwc:start
(node:20104) TypeError Plugin: @salesforce/lwc-dev-server: Cannot read properties of undefined (reading 'prototype')
module: @oclif/[email protected]
task: toCached
plugin: @salesforce/lwc-dev-server
root: C:\Users\xxxx\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server
See more details with DEBUG=*

Is local development even supported in March 2023? Looks like abandoned project but would love to get some confirmation from Salesforce.

2 Answers 2

1

From your description and logs, it seems like a compatibility issue between sfdx plugin and oclif version.

Update the @oclif/core module to the latest version by running the command npm install @oclif/core@latest, and reinstall the lwc-dev-server plugin.

Alternative approach, try updating the sfdx cli sfdx update and reinstalling the plugin.

5
  • do you have this working on your machine? FWIW, I have tried all updates and nothing has worked.
    – PAS
    Commented Mar 26, 2023 at 23:13
  • Yes, I am using it on M2 Mac. I did run into issues related to node-gyp
    – roh777x
    Commented Mar 27, 2023 at 18:20
  • @ roh777x, can you please let know what node version you are using? I suspect I really need to downgrade node in order to make this work.
    – PAS
    Commented Mar 28, 2023 at 13:35
  • I am using Node v18.3
    – roh777x
    Commented Mar 28, 2023 at 16:58
  • thanks @ roh777x
    – PAS
    Commented Mar 28, 2023 at 18:13
1

I was able to overcome this by uninstalling Node v19.8.1 and installing Node v18.15.0.

You must log in to answer this question.

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