forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
953 stars 406 forks source link

`npm install` is failing due eslint dependency #5953

Open megasmack opened 15 hours ago

megasmack commented 15 hours ago

Summary

After creating a project using the VSCode Extension, I get an error when running npm install.

Steps To Reproduce:

  1. Create a new project using the VSCode Extension.
  2. Run npm install.

Expected result

npm should install all dependencies for the project

Actual result

I get the following error:

$ npm install
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: salesforce-app@1.0.0
npm error Found: eslint@9.15.0
npm error node_modules/eslint
npm error   dev eslint@"^9.9.1" from the root project
npm error   peer eslint@"^7.5.0 || ^8.0.0 || ^9.0.0" from @babel/eslint-parser@7.25.9
npm error   node_modules/@babel/eslint-parser
npm error     peer @babel/eslint-parser@"^7" from @lwc/eslint-plugin-lwc@1.8.2
npm error     node_modules/@lwc/eslint-plugin-lwc
npm error       dev @lwc/eslint-plugin-lwc@"^1.1.2" from the root project
npm error
npm error Could not resolve dependency:
npm error peer eslint@"^7 || ^8" from @lwc/eslint-plugin-lwc@1.8.2
npm error node_modules/@lwc/eslint-plugin-lwc
npm error   dev @lwc/eslint-plugin-lwc@"^1.1.2" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/steveschrab/.npm/_logs/2024-11-19T15_07_57_992Z-eresolve-report.txt

Additional information

Salesforce Extension Version in VS Code: 62.5.1 Salesforce CLI Version: @salesforce/cli/2.66.7 darwin-arm64 node-v22.11.0 OS and version: MacOS Sequoia 15.0.1 14.5 VS Code version: 1.95.3 Most recent version of the extensions where this was working: No idea.

We looked into this issue on the CLI repo where it looks like it's an issue in the extension versus the CLI. https://github.com/forcedotcom/cli/issues/3098

The main thing I spotted was that creating a project directly through the sf cli creates a package.json using "eslint": "^8.57.0" while VSCode plugin generates a package.json using "eslint": "^9.9.1". This looks like it's conflicting with the eslint-plugin-lwc package that requires "eslint": "^8.57.0".

svc-idee-bot commented 15 hours ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

svc-idee-bot commented 15 hours ago

Hello @megasmack :wave: It looks like you didn't provide all the required basic info in your issue.

If you haven't already, please provide the following info: Salesforce Extension Version in VS Code: Salesforce CLI Version: OS and version: VS Code version: Most recent version of the extensions where this was working:

Here's an example of a set of required info that will pass the validation: Salesforce Extension Version in VS Code: 60.13.0 Salesforce CLI Version: @salesforce/cli/2.42.6 darwin-arm64 node-v18.18.2 OS and version: MacOS Sonoma 14.5 VS Code version: 1.89.1 Most recent version of the extensions where this was working: 60.11.0

A few more things to check:

Thank you!

git2gus[bot] commented 14 hours ago

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

peternhale commented 14 hours ago

@megasmack I have conformed the error you are seeing in the generated project and have logged a bug.

The workaround is to change eslint to version 8.57.0 and change script postinstall to "husky init"