Here is the output I have after getting audit warnings after installing an npm package:
$ npm audit fix
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! dev @typescript-eslint/eslint-plugin@"^5.46.1" from the root project
npm ERR! peerOptional @typescript-eslint/eslint-plugin@"^5.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-unused-imports
npm ERR! dev eslint-plugin-unused-imports@"^2.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/eslint-plugin@"^4.0.1" from [email protected]
npm ERR! node_modules/eslint-config-standard-with-typescript
npm ERR! dev eslint-config-standard-with-typescript@"^21.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! peer @typescript-eslint/eslint-plugin@"^4.0.1" from [email protected]
npm ERR! node_modules/eslint-config-standard-with-typescript
npm ERR! dev eslint-config-standard-with-typescript@"^21.0.1" 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/lancepollard/.npm/_logs/2023-01-02T17_19_47_490Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lancepollard/.npm/_logs/2023-01-02T17_19_47_490Z-debug-0.log
That came after running npm audit fix --force
a few times, after getting this:
$ npm install eslint-plugin-unused-imports --save-dev
added 2 packages, and audited 379 packages in 4s
107 packages are looking for funding
run `npm fund` for details
5 high severity vulnerabilities
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Any ideas what I should be doing here to resolve and get a successful install?
My package.json
is:
{
"main": "./host",
"type": "module",
"scripts": {
"build": "tsc && tsc-alias",
"watch": "concurrently --kill-others \"tsc -w\" \"tsc-alias -w\"",
"lint": "eslint --ext .ts ./make",
"lint:fix": "npm run lint -- --fix",
"test": "node host/task/build"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"@types/glob": "^8.0.0",
"@types/lodash": "^4.14.191",
"@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"concurrently": "^7.6.0",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard-with-typescript": "^21.0.1",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.24.1",
"eslint-plugin-n": "^15.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-sort-exports": "^0.8.0",
"eslint-plugin-sort-keys": "^2.3.5",
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"eslint-plugin-unused-imports": "^2.0.0",
"prettier": "2.8.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.2",
"typescript": "^4.9.4"
},
"dependencies": {
"@lancejpollard/pretty-compact-json.js": "^0.2.0",
"chalk": "^5.2.0",
"glob": "^8.0.3",
"lodash": "^4.17.21",
"source-map": "^0.7.4"
}
}
Now I have rm -rf node_modules
, and when I do npm install
again, it shows the same error....
CodePudding user response:
I had the same problem. Deleting the package-lock.json and the node_modules, and then running npm install solved my issue.
I hope it helps.