I have been attempting to install jest using npm, both locally and globally, but it fails to install.
My npm version is 7.5.2 and my node version is 12.22.5. I am using ubuntu.
I have tried the following commands:
npm i -D jest
npm i -g jest
npm i jest
However, jest does not get installed.
This is the error message I receive: alireza@SUCCESS:~/Desktop/test$ sudo npm i -D jest [sudo] password for alireza: npm ERR! code FETCH_ERROR npm ERR! errno FETCH_ERROR npm ERR! invalid json response body at https://registry.npmjs.org/@jest%2ftransform reason: Unexpected end of JSON input
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-02-14T12_19_47_677Z-debug.log