Closed JanetWhite closed 1 week ago
Thanks for the bug report. I am not able to reproduce using Node v20.11.0 and npm v10.4.0 on macOS.
Repro:
mkdir temp
cd temp
npm init --yes
npm install @salesforce/sfdx-lwc-jest --save-dev
Result: installs successfully.
Could you please try the steps above and see if it's related to 1) your project configuration, 2) Windows, 3) your npm version being v9 instead of v10, or 4) something else?
I'm getting a similar error.
Running:
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
npm error A complete log of this run can be found in: /Users/steveschrab/.npm/_logs/2024-11-19T15_07_57_992Z-debug-0.log
If I run the command with either --force
or --legacy-peer-deps
, I end up with husky/eslint errors.
Based on the error logs that have been shared, the issue is occurring because @lwc/eslint-plugin-lwc
requires eslint 8, but the root project dependencies require eslint 9. It seems that you are using the Salesforce CLI, so the issue is likely with whichever template you used to generate a project. To figure out which dependencies are trying to pull in eslint, you can execute npm ls eslint
. After you do that, you should report the issue to the relevant project and provide the full steps to reproduce, including generating a new project.
Closing this issue as it is unrelated to sfdx-lwc-jest.
vs code projects\new_lwc> npm --version 9.7.2 vs code projects\new_lwc> node --version v20.17.0 vs code projects\new_lwc> sf --version @salesforce/cli/2.66.7 win32-x64 node-v20.17.0
vs code projects\new_lwc> npm install @salesforce/sfdx-lwc-jest --save-dev npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: salesforce-app@1.0.0 npm ERR! Found: eslint@9.14.0 npm ERR! node_modules/eslint npm ERR! dev eslint@"^9.9.1" from the root project npm ERR! peer eslint@"^7.5.0 || ^8.0.0 || ^9.0.0" from @babel/eslint-parser@7.25.9 npm ERR! node_modules/@babel/eslint-parser npm ERR! peer @babel/eslint-parser@"^7" from @lwc/eslint-plugin-lwc@1.8.2 npm ERR! node_modules/@lwc/eslint-plugin-lwc npm ERR! dev @lwc/eslint-plugin-lwc@"^1.1.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer eslint@"^7 || ^8" from @lwc/eslint-plugin-lwc@1.8.2 npm ERR! node_modules/@lwc/eslint-plugin-lwc npm ERR! dev @lwc/eslint-plugin-lwc@"^1.1.2" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! C:\Users\User\AppData\Local\npm-cache_logs\2024-11-15T16_48_04_174Z-eresolve-report.txt
I founda similar report on an older version of SF here - https://github.com/forcedotcom/cli/issues/3098
Thank you