0

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 > request-promise-native@1.0.9" has unmet peer dependency "request@^2.34".
warning "sfdx-plugin-source-read > @salesforce/command > @oclif/test > @oclif/core > ts-node@10.9.1" has unmet peer dependency "@types/node@*".
warning "sfdx-plugin-source-read > @salesforce/command > @oclif/test > @oclif/core > ts-node@10.9.1" 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/core@2.6.2
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/core@2.6.2
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

0

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
    Mar 26 at 23:13
  • Yes, I am using it on M2 Mac. I did run into issues related to node-gyp
    – roh777x
    Mar 27 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
    Mar 28 at 13:35
  • I am using Node v18.3
    – roh777x
    Mar 28 at 16:58
  • thanks @ roh777x
    – PAS
    Mar 28 at 18:13
0

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 .