Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ERROR Cannot find module '/home/runner/.local/share/sfdx/node_modules/eslint/conf/eslint-recommended.js' #986

Closed
PreziosiRaffaele opened this issue Feb 26, 2023 · 23 comments
Labels
BUG P1 High Priority Malfunction

Comments

@PreziosiRaffaele
Copy link

PreziosiRaffaele commented Feb 26, 2023

Describe the bug
ERROR Cannot find module '/home/runner/.local/share/sfdx/node_modules/eslint/conf/eslint-recommended.js'

To Reproduce
Run command
sfdx scanner:run --format sarif --target './**/*.cls' --engine=pmd --pmdconfig ruleset.xml --outfile 'apexScanResults.sarif'

Expected behavior
Rule violations were written to apexScanResults.sarif.

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.2 LTS
  • Scanner Version: v3.9.0

Additional context
Friday 24/02/2023 same pipeline was working

"Workaround": Removing the SFDX scanner from the pipeline
"Urgency": Highly beneficial

@rmohan20
Copy link
Contributor

@PreziosiRaffaele - thanks for reporting. Pinning this issue for more visibility.

Looks like every user who needs to install @salesforce/sfdx-scanner plugin now is affected. Users who already have Code Analyzer setup in their environment should be safe.

Will add more information as I find it.

@rmohan20 rmohan20 pinned this issue Feb 26, 2023
@PreziosiRaffaele PreziosiRaffaele changed the title ERROR Cannot find module '/home/runner/.local/share/sfdx/node_modules/eslint/conf/eslint-recommended.js' [BUG] ERROR Cannot find module '/home/runner/.local/share/sfdx/node_modules/eslint/conf/eslint-recommended.js' Feb 26, 2023
@nvuillam
Copy link

I have exactly the same error in MegaLinter (that embeds sfdx-scanner)

@vaibhavdangar-woolies
Copy link

vaibhavdangar-woolies commented Feb 27, 2023

Hi, please advise if we have any workaround, issue is impacting CICD?
Installed pluggin
@salesforce/sfdx-scanner 3.9.0

WARNING: We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at https://research.net/r/SalesforceCA
ERROR running scanner:run: Cannot find module '/home/vsts_azpcontainer/.local/share/sfdx/node_modules/eslint/conf/eslint-recommended.js'
Require stack:

  • /home/vsts_azpcontainer/.local/share/sfdx/node_modules/@salesforce/sfdx-scanner/lib/lib/eslint/JavascriptEslintStrategy.js
  • /home/vsts_azpcontainer/.local/share/sfdx/node_modules/@salesforce/sfdx-scanner/lib/lib/eslint/EslintEngine.js
  • /home/vsts_azpcontainer/.local/share/sfdx/node_modules/@salesforce/sfdx-scanner/lib/ioc.config.js
  • /home/vsts_azpcontainer/.local/share/sfdx/node_modules/@salesforce/sfdx-scanner/lib/lib/hooks/init.js
  • /usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/config/lib/config.js
  • /usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/config/lib/index.js
  • /usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/command.js
  • /usr/local/lib/nodejs/lib/node_modules/sfdx-cli/node_modules/@oclif/command/lib/index.js
  • /usr/local/lib/nodejs/lib/node_modules/sfdx-cli/dist/cli.js
  • /usr/local/lib/nodejs/lib/node_modules/sfdx-cli/bin/run

@rmohan20
Copy link
Contributor

Sorry for the delay. We have more clarity on the issue, but the fix is still pending.

The root cause is that eslint made a change to breakaway the eslint-recommended config into its own dependency in 8.35.0. This has caused the reference from Code Analyzer to this config to break.

A workaround would be to temporarily install from CI/CD, Salesforce CLI version 7.179.0, which somehow refers to an older version of eslint.

npm install -g sfdx-cli@7.179.0

Will update you with an ETA for the fix tomorrow morning.

@vaibhavdangar-woolies
Copy link

Hi @rmohan20 , Thanks for quick reply. I'll check on the workaround suggested.

@noerremark
Copy link

7.179.0 doesn't work for me :-(

 ›   Warning: sfdx-cli update available from 7.179.0 to 7.188.1.
WARNING: We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at https://research.net/r/SalesforceCA
ERROR running scanner:run:  Cannot find module '/home/vsts_azpcontainer/.local/share/sfdx/node_modules/eslint/conf/eslint-recommended.js'

@vaibhavdangar-woolies
Copy link

7.179.0 doesn't work for me :-(

 ›   Warning: sfdx-cli update available from 7.179.0 to 7.188.1.
WARNING: We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at https://research.net/r/SalesforceCA
ERROR running scanner:run:  Cannot find module '/home/vsts_azpcontainer/.local/share/sfdx/node_modules/eslint/conf/eslint-recommended.js'

correct, same error

@Esabilin
Copy link

We are having the same issue, our CI is broken because of this..

@constantine-prokopenko-vrp

As temp workaround, I manually created file using latest version from the eslint repo.
Here is the file

@Mikelsoma
Copy link

We also have error !!
image

@johnbelosf
Copy link
Collaborator

Thank you all for bearing with us on this. We are working to issue a fix ASAP.

@git2gus
Copy link

git2gus bot commented Feb 27, 2023

This issue has been linked to a new work item: W-12608309

@rmohan20
Copy link
Contributor

Update: the fix is ready. We are planning to make a release in the next few hours.

@vnehess
Copy link

vnehess commented Feb 27, 2023

Thanks for addressing this issue, it is important to users who rely on the scanner in their CI process, like our company.
please let us know when it is available. Currently, we are blocked unless we remove the scanner 😢 from our builds

@rmohan20
Copy link
Contributor

The fix is now available with the latest 3.10.0 version.
Thank you all for your patience - truly appreciate it!

@andreyshestakov-phsa
Copy link

The pligin now works fine, thanks!

@PreziosiRaffaele
Copy link
Author

I can confirm that is working fine for me. Thank you for resolving this issue so quickly!

@nvuillam
Copy link

All good in MegaLinter sfdx-scanner integration :)

@constantine-prokopenko-vrp

Many thanks
Works fine for me

@noerremark
Copy link

Also confirmed fixed from us! Thanks for helping out...

@vaibhavdangar-woolies
Copy link

Issue resolved, many thanks to @rmohan20

@sameer544
Copy link

Work fine in our Azure DevOps pipeline. Thank you for the quick fix :)

@Esabilin
Copy link

Works for us, thanks!

@rmohan20 rmohan20 unpinned this issue Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG P1 High Priority Malfunction
Projects
None yet
Development

No branches or pull requests