Categories
Uncategorized

npm install error due to typescrip dev dependency or following error

If you face any similar kind of log error during npm install for react:

7090 verbose stack FetchError: invalid json response body at https://registry.npmjs.org/@typescript-eslint%2ftypescript-estree reason: Unexpected end of JSON input7090 verbose stack     at C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\body.js:77:317090 verbose stack     at async Promise.all (index 60)7090 verbose stack     at async Arborist.[buildDepStep] (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:854:5)7090 verbose stack     at async Arborist.buildIdealTree (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:209:7)7090 verbose stack     at async Promise.all (index 1)7090 verbose stack     at async Arborist.reify (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:127:5)7090 verbose stack     at async install (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\lib\install.js:38:3)7091 verbose cwd C:\Users\HP\Documents\team-captain\frontend7092 verbose Windows_NT 10.0.190427093 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "typescript" "--save-dev"7094 verbose node v12.17.07095 verbose npm  v7.5.27096 error code FETCH_ERROR7097 error errno FETCH_ERROR7098 error invalid json response body at https://registry.npmjs.org/@typescript-eslint%2ftypescript-estree reason: Unexpected end of JSON input7099 verbose exit 1

run following command to clean up npm cache or manually delete the npm-cache folder using path from the above log generation in command line interface.
or update your npm version to the latest version with using following command:
npm install -g npm@latest(or specific to latest version)
like here