Every time I try installing any package or even if I try doing npm install
I keep getting this error. I have no idea why I am getting the error. I am totally ne
For this type of error try with below steps:
Delete package-lock.json
Run npm install
The above solution worked correctly for me. Hope will work for you.
try to remove package.lock file
Possible issue here
For me, deleting package.lock
was not enough. My IDE always said this error:
Unexpected token <
So what I did:
npm cache verify
I write in the plain command-line interpreter , NOT in IDE :
npm install @angular/http
It's because of package-lock.json
. I just run the rm package-lock.json
and It works for me.
For me , removing package.lock did not work
Try the following steps
1- set registry to https://registry.npmjs.org/
. http
did not work and had to change it to https
npm config set registry https://registry.npmjs.org/
2- I am behind a corporate firewall so i had to setup my proxy and https-proxy accordingly in the format - http://yourproxyurl:port
npm config set proxy http://someproxyurl.com:8080
npm config set https-proxy http://someproxyurl.com:8080
3 - Set ssl
to false
npm config set strict-ssl false
These steps worked for me. Hope this helps.
I just delete the package-lock.json and run npm i
again, it works for me