Anytime I run npm install --force, I face this error

Viewed 448

Am having this error when running npm i --force, npm i don't even run, it shows bunch of errors

npm ERR! code ECONNRESET

npm ERR! errno ECONNRESET npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/react-hook-form: aborted npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in: npm ERR! /home/heiscostly/.npm/_logs/2021-05-11T06_27_03_886Z-debug.log

1 Answers

The error itself explains that there is some issue with network connectivity.
Below mentioned questions will help you troubleshoot the issue

  • Does this happen only for react-hook-form or it happens for all the packages?
  • Does installation work without the --force parameter?
  • Are you using the latest npm version? You can check using npm -v.
  • Execute curl https://registry.npmjs.org/react-hook-form to check whether your computer can access the page. (If you can't or curl fails then there is a problem with your computer settings, not npm)
Related