-2

enter image description hereI deleted the node modules and package.json.lock file in my client side MERN Stack project folder and tried reinstalling the node modules by typing "npm install" command in the terminal. but it's showing me an error. 1. I have tried clearing cache using "npm cache clean --force". 2. I have tried reinstalling npm using "npm install -g npm". 3. I have tried updating the npm using "npm install -g npm@latest".

But nothing works. Please help me resolve this issue. below are my package.json file and the error in my terminal while installing node modules. error in terminal

i was expecting that node modules will be reinstalled with all the dependencies mentioned in my package.json file.

Macfros
  • 7
  • 2

1 Answers1

1

NPM changed the way of resolving peer dependencies in v7, but this new way does not allow conflicting dependencies in the dependency tree. The simplest way to solve this would be to use the --legacy-peer-deps option to use the old way of resolving dependencies.

The hard(but better) way to solve it would be to spend some time to update the dependencies in a way that there is no conflicting dependency.

akshatdb
  • 29
  • 2