xxxxxxxxxx
npm ERR! code EJSONPARSE
npm ERR! path /gulpProject/package.json
npm ERR! JSON.parse Unexpected end of JSON input while parsing "\n"
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-26T05_14_01_813Z-debug-0.log
xxxxxxxxxx
npm cache clean --force
then run npm i
xxxxxxxxxx
This is not a definitive answer but it looks like your global packages are corrupted in some way.
This bug may be caused by many different things. I suggest doing the following.
1 Install Node Version Manager (or NVM for Windows) and install Node version 10.16.1. This is enough for angular 9 and from my experience it is the most stable version for development. This should also change your NPM version so that may also help.
2 Uninstall global angular package npm uninstall -g @angular/cli
3 Force clear cache npm cache clean --force
4 Just to double check npm cache verify
5 You can also try clearing your %temp% and %roaming% AppData/npm-cache
6 install latest angular package npm install -g @angular/cli@<your-version>
7 if this error still occurs, consider using another shell
If this don't solve the problem try to manually locate the package.json file that is throwing an error and investigate.
xxxxxxxxxx
Open Windows Powershell as admin
npm cache clean --force
solved the problem for me
Alternative : You can use yarn instead
npm install -g yarn
xxxxxxxxxx
To solve AxiosError: unexpected end of file You need to Downgrade the Axios version to 1.2.0. In My case, I have Updated My Axios to the 1.2.1 Latest version and then I was facing this error So That I reverted back to 1.2.0 to solve My error. You can run this command to downgrade Axios.
npm i axios@1.2.0
And now, Your error will be solved.