2

I am getting following error while running npm uninstall... Can anyone please help to resolve... I have done almost everything to fix this...

npm WARN react-star-rating-component@1.4.1 requires a peer of react@^16.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package detect-port is included as both a dev and production dependency.

audited 17423 packages in 20.551s
found 40 vulnerabilities (7 low, 31 moderate, 1 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

And when I run npm audit it gives me following = error

npm ERR! code ELOCKVERIFY
npm ERR! Errors were found in your package-lock.json, run  npm install  to fix them.
npm ERR!     Invalid: lock file's detect-port@1.2.3 does not satisfy detect-port@1.0.1

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-06-25T12_13_53_712Z-debug.log
Ashwini singh
  • 51
  • 1
  • 7
  • executing `npm audit` will show you details (as stated in the output) and also provide commands to update the respective libraries. – Sirko Jun 25 '18 at 12:12
  • @Sirko Thanks for the reply... Please check updated question – Ashwini singh Jun 25 '18 at 12:15
  • The error states the problem (at least one): your installed version of `detect-port` does not match the version as requested in your `package.json`. I'll start fixing that. – Sirko Jun 25 '18 at 12:36
  • @Sirko thanks , but how to fix this error .And are you main developer for it ... – Ashwini singh Jun 25 '18 at 12:46
  • Take a look at your package JSON. There will be an entry for `detect-port` under `dependencies`. The syntax for the version number is explained [here](https://docs.npmjs.com/files/package.json#dependencies). Make sure that version `1.2.3` is compliant with the version requested there. – Sirko Jun 25 '18 at 12:51

1 Answers1

1

Try removing detect-port dependency from both Dependencies and devDependencies in package.json file and remove it from node_modules and add detect-port with the version and run npm install and npm audit fix. this solves my problem but not with this package.

Afsal
  • 21
  • 3