i am trying to install sfdx scanner. its giving me this error. anyone knows this below error

warning "@salesforce/lwc-dev-server > request-promise-native > [email protected]" has unmet peer dependency "request@^2.34".
C:\Program Files\Salesforce CLI\client\node_modules\yarn\lib\cli.js:78723
    compromised = compromised || function (err) { throw err; };

Error: Unable to update lock within the stale threshold
    at C:\Program Files\Salesforce CLI\client\node_modules\yarn\lib\cli.js:78645:66
    at FSReqCallback.oncomplete (fs.js:156:23) {
Installing plugin @salesforce/sfdx-scanner... failed
    Error: yarn add @salesforce/sfdx-scanner@latest --non-interactive 
    --preferred-cache-folder=C:\Users\XXXXXXXXXX\AppData\Local\sfdx\yarn --check-files       
    exited with code 1

after installing

@salesforce/lwc-dev-server 2.9.0
├─ @oclif/plugin-help 2.2.3
└─ @oclif/plugin-update 1.3.10
evergreen 0.34.0
└─ evergreen-build 0.20.2
(node:14504) [UnknownConfigKey Plugin: sfdx-cli] UnknownConfigKey Plugin: sfdx-cli: Unknown config key: disableTelemetry
module: @oclif/[email protected]
task: runHook prerun
plugin: sfdx-cli
root: C:\Program Files\Salesforce CLI\client
See more details with DEBUG=*
  • Apparently this is an issue with a yarn timeout that is set too tight. I faced the same problem during sfdx plugin updates and was able to work around it by - running it again and again. Each time the process got a bit further, partially building on the last one. After three or four iterations, the downloads, linking etc. had got so far that it finished successfully inside the timeout. Commented Jul 9, 2021 at 12:07

2 Answers 2


Try reinstalling the lwc-dev-server:

npm install -g @salesforce/lwc-dev-server @salesforce/sfdx-scanner

Remove the -g if you only want it installed locally (within the current project).

Add --save-dev if you want to also update your package.json file.

  • hi sfdcfox.. thank you for the help.. after installing i checked for sfdx plugins. i didnt find sfdx scanner..there were many deprecated packages while installing... i hv updated above Commented Jan 22, 2021 at 19:13

I resolved this issue by restarting Visual Studio Code after installing node.js

You must log in to answer this question.

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