Reputation: 77
So this error randomly popped up while I was working on my project:
I've searched online and most of the answers ask to run npm cache clean --force
.
This did not work for me :(
I've also tried to reinstall npm but still get the same error.
Here is the error-log:
I've been stuck on this for a while hoping someone can help me out :/
Upvotes: 0
Views: 3605
Reputation: 159
For my Vue.js project this problem was solved by first deleting the package-lock.json file and then running npm install
Comment from @user2864740 helped point me in this direction, thank you!
Upvotes: 0
Reputation: 5205
try npm cache clean --force
, fixed the issue for me.
ref: npm-err-unexpected-end-of-json-input-while-parsing-near-743
Upvotes: 1
Reputation: 109
You can try "yarn" instead of npm.
Installation (If you are using Mac):
brew install yarn
Or check here https://classic.yarnpkg.com/en/docs/install/
Then just run (Works like "npm install")
yarn
Upvotes: 1
Reputation: 70
You should try to reinstall entirely nodejs from your computer. This could solve the problem.
sudo apt-get remove nodejs
sudo apt-get install nodejs
Upvotes: 1