Search code examples
ubuntunode-modulesnpm-installwindows-subsystem-for-linux

Conflict with Peer Dependencies in npm install (Invenio-cli install)


I'm facing an issue while running npm install for my Node.js project. It seems there is a conflict with peer dependencies, and I'm unable to resolve it. I'm using Node.js version 12.22.9 and npm version 9.8.1. The project is built with React and TypeScript. When I run npm install or invenio-cli install, I get the following error:

npm ERR! ERESOLVE could not resolve
npm ERR! While resolving: @typescript-eslint/eslint-plugin@2.34.0
npm ERR! Found: eslint@7.32.0
npm ERR! Conflicting peer dependency: eslint@6.8.0

Project Structure:

- Project root
  - package.json
  - node_modules
  - ... (other project files)

Package.json (project level):

{
  "name": "hmm",
  "version": "1.0.0",
  "description": "Welcome to your InvenioILS instance.",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "postinstall": "npm install --force"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@ckeditor/ckeditor5-react": "2.1.0",
    "@craco/craco": "5.9.0",
    "@emotion/core": "^11.0.0",
    "@emotion/react": "11.7.0",
    "@hookform/error-message": "1.1.0",
    "@hookform/resolvers": "1.1.0",
    "@testing-library/jest-dom": "5.14.1",
    "@testing-library/react": "12.0.0",
    "@testing-library/user-event": "13.1.9",
    "@types/classnames": "2.3.1",
    "@types/lodash": "4.14.173",
    "@types/react": "17.0.37",
    "@types/react-dom": "17.0.11",
    "@typescript-eslint/eslint-plugin": "2.34.0",
    "@typescript-eslint/parser": "2.34.0",
    "axios": "^0.21.4",
    "classnames": "2.3.1",
    "eslint-plugin-flowtype": "5.8.0",
    "eslint-plugin-import": "2.25.3",
    "eslint-plugin-jsx-a11y": "6.4.1",
    "eslint-plugin-react": "7.26.1",
    "eslint-plugin-react-hooks": "4.3.0",
    "lodash": "4.17.21",
    "query-string": "7.0.1",
    "react": "16.14.0",
    "react-dom": "16.14.0",
    "react-invenio-forms": "2.4.0",
    "react-select": "^5.0.0",
    "react-toastify": "8.0.3",
    "react-transition-group": "4.4.2",
    "recoil": "0.3.1",
    "sweetalert2": "11.1.0",
    "yup": "0.32.11"
  },
  "devDependencies": {
    "eslint": "7.32.0",
    "@typescript-eslint/parser": "2.34.0",
    "eslint-config-react-app": "5.2.1"
  },
  "resolutions": {
    "eslint": "^7.32.0",
    "eslint-config-react-app": "^5.2.1",
    "@typescript-eslint/parser": "^2.34.0"
  }
}

Current Output: I'm getting the error message mentioned above.

Expected Output: I expect npm install to run without any conflict and install all the dependencies successfully.

Additional Information:

I have tried running npm install --force, but it didn't resolve the issue. I have also tried running npm install --legacy-peer-deps, but it didn't work either. I have shared the output of npm list, npm outdated, and npm list -g --depth=0 in this post to provide more context about my project setup. Node.js version: 12.22.9 npm version: 9.8.1

Output of npm list:

algorithmx@Torime:~/hmm$ npm list
hmm@1.0.0 \\wsl.localhost\Ubuntu\home\algorithmx\hmm
+-- @ckeditor/ckeditor5-react@2.1.0
+-- @craco/craco@5.9.0
+-- @emotion/core@11.0.0
+-- @emotion/react@11.7.0
+-- @hookform/error-message@1.1.0
+-- @hookform/resolvers@1.1.0
+-- @testing-library/jest-dom@5.14.1
+-- @testing-library/react@12.0.0
+-- @testing-library/user-event@13.1.9
+-- @types/classnames@2.3.1
+-- @types/lodash@4.14.173
+-- @types/react-dom@17.0.11
+-- @types/react@17.0.37
+-- @typescript-eslint/eslint-plugin@2.34.0
+-- @typescript-eslint/parser@2.34.0
+-- axios@0.21.4
+-- classnames@2.3.1
+-- eslint-config-react-app@5.2.1
+-- eslint-plugin-flowtype@5.8.0
+-- eslint-plugin-import@2.25.3
+-- eslint-plugin-jsx-a11y@6.4.1
+-- eslint-plugin-react-hooks@4.3.0
+-- eslint-plugin-react@7.26.1
+-- eslint@7.32.0
+-- lodash@4.17.21
+-- query-string@7.0.1
+-- react-dom@16.14.0
+-- react-invenio-forms@2.4.0
+-- react-select@5.7.4
+-- react-toastify@8.0.3
+-- react-transition-group@4.4.2
+-- react@16.14.0
+-- recoil@0.3.1
+-- sweetalert2@11.1.0
`-- yup@0.32.11

Output of npm outdated:

algorithmx@Torime:~/hmm$ npm outdated
Package                            Current    Wanted    Latest  Location
 Depended by
@ckeditor/ckeditor5-react            2.1.0     2.1.0     6.1.0  node_modules/@ckeditor/ckeditor5-react         hmm
@craco/craco                         5.9.0     5.9.0     7.1.0  node_modules/@craco/craco
 hmm
@emotion/react                      11.7.0    11.7.0   11.11.1  node_modules/@emotion/react
 hmm
@hookform/error-message              1.1.0     1.1.0     2.0.1  node_modules/@hookform/error-message
 hmm
@hookform/resolvers                  1.1.0     1.1.0     3.1.1  node_modules/@hookform/resolvers
 hmm
@testing-library/jest-dom           5.14.1    5.14.1    5.17.0  node_modules/@testing-library/jest-dom         hmm
@testing-library/react              12.0.0    12.0.0    14.0.0  node_modules/@testing-library/react
 hmm
@testing-library/user-event         13.1.9    13.1.9    14.4.3  node_modules/@testing-library/user-event       hmm
@types/lodash                     4.14.173  4.14.173  4.14.196  node_modules/@types/lodash
 hmm
@types/react                       17.0.37   17.0.37   18.2.17  node_modules/@types/react
 hmm
@types/react-dom                   17.0.11   17.0.11    18.2.7  node_modules/@types/react-dom
 hmm
@typescript-eslint/eslint-plugin    2.34.0    2.34.0     6.2.0  node_modules/@typescript-eslint/eslint-plugin  hmm
@typescript-eslint/parser           2.34.0    2.34.0     6.2.0  node_modules/@typescript-eslint/parser         hmm
axios                               0.21.4    0.21.4     1.4.0  node_modules/axios
 hmm
classnames                           2.3.1     2.3.1     2.3.2  node_modules/classnames
 hmm
eslint                              7.32.0    7.32.0    8.46.0  node_modules/eslint
 hmm
eslint-config-react-app              5.2.1     5.2.1     7.0.1  node_modules/eslint-config-react-app
 hmm
eslint-plugin-flowtype               5.8.0     5.8.0     8.0.3  node_modules/eslint-plugin-flowtype
 hmm
eslint-plugin-import                2.25.3    2.25.3    2.28.0  node_modules/eslint-plugin-import
 hmm
eslint-plugin-jsx-a11y               6.4.1     6.4.1     6.7.1  node_modules/eslint-plugin-jsx-a11y
 hmm
eslint-plugin-react                 7.26.1    7.26.1    7.33.1  node_modules/eslint-plugin-react
 hmm
eslint-plugin-react-hooks            4.3.0     4.3.0     4.6.0  node_modules/eslint-plugin-react-hooks         hmm
query-string                         7.0.1     7.0.1     8.1.0  node_modules/query-string
 hmm
react                              16.14.0   16.14.0    18.2.0  node_modules/react
 hmm
react-dom                          16.14.0   16.14.0    18.2.0  node_modules/react-dom
 hmm
react-toastify                       8.0.3     8.0.3     9.1.3  node_modules/react-toastify
 hmm
react-transition-group               4.4.2     4.4.2     4.4.5  node_modules/react-transition-group
 hmm
recoil                               0.3.1     0.3.1     0.7.7  node_modules/recoil
 hmm
sweetalert2                         11.1.0    11.1.0   11.7.20  node_modules/sweetalert2
 hmm
yup                                0.32.11   0.32.11     1.2.0  node_modules/yup
 hmm

Output of npm list -g --depth=0:

algorithmx@Torime:~/hmm$ npm list -g --depth=0
C:\Users\Sammie\AppData\Roaming\npm
+-- @exlibris/exl-cloudapp-cli@1.4.7
+-- node-sass@
`-- npm@9.8.1

Any help in resolving this conflict with peer dependencies would be greatly appreciated! Thank you in advance.


Solution

  • The current version of InvenioILS still uses NodeJS v14, which comes with npm v6. Please try again with these versions.