If I create a project from scratch.
mkdir test
cd test && npm init -y
Then install install the dependencies like this it works fine.
npm uninstall rollup-plugin-terser && npm i -D typedoc@latest typescript@latest @rollup/plugin-terser@latest rollup-plugin-summary@latest @rollup/plugin-node-resolve@latest rollup@latest @web/dev-server@latest rimraf@latest prettier@latest lit-analyzer@latest lit@latest @web/test-runner-playwright@latest @web/test-runner@latest @web/dev-server-legacy@latest @web/dev-server@latest @rollup/plugin-replace@latest @rollup/plugin-node-resolve@latest @open-wc/testing@latest @custom-elements-manifest/analyzer@latest @11ty/eleventy@latest @11ty/eleventy-plugin-syntaxhighlight@latest @types/mocha @typescript-eslint/parser@latest
However when trying to install the same dependencies via package.json fails. Here’s the attempted sequence.
mkdir test2
cd test2 && npm init -y
Add the dependencies.
"devDependencies": {
"@11ty/eleventy": "^2.0.1",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"@custom-elements-manifest/analyzer": "^0.10.2",
"@open-wc/testing": "^4.0.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-terser": "^0.4.4",
"@types/mocha": "^10.0.6",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^7.12.0",
"@web/dev-server": "^0.4.5",
"@web/dev-server-legacy": "^2.1.1",
"@web/test-runner": "^0.18.2",
"@web/test-runner-playwright": "^0.11.0",
"@webcomponents/webcomponentsjs": "^2.8.0",
"eslint": "^8.15.0",
"lit": "^3.1.4",
"lit-analyzer": "^2.0.3",
"prettier": "^3.3.1",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"rollup-plugin-summary": "^2.0.1",
"typedoc": "^0.25.13",
"typescript": "^5.4.5"
}
And then run.
npm i
It fails with this error.
test2 % npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/parser
npm ERR! dev @typescript-eslint/parser@"^7.12.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/parser@"^5.0.0" from @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! dev @typescript-eslint/eslint-plugin@"^5.25.0" 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! /Users/oleersoy/.npm/_logs/2024-06-07T02_39_55_805Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/oleersoy/.npm/_logs/2024-06-07T02_39_55_805Z-debug-0.log
I’m trying to create a baseline project for lit with updated dependencies that that others can use as a starting point.
Any ideas on how to get around this issue?