Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failing to parse json Bower package.json file

Tags:

bower

ubuntu

I'm following along with this tutorial https://www.digitalocean.com/community/articles/how-to-install-and-use-bower-on-your-vps I get the errors you see below. Any ideas what the problem might be?to install Bower on a remote server Ubuntu 13.0.4.. After I install git core, it tells me to run npm install -g bower. When I do that, it gives me an error message about the package.json file. However, I'm wondering if that's an accurate error message because I can install bower on my local machine without problem.

npm http 304 https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/unzip
npm http 304 https://registry.npmjs.org/tmp
npm http 304 https://registry.npmjs.org/update-notifier
npm http 304 https://registry.npmjs.org/which
npm ERR! Failed to parse json
npm ERR! Unexpected end of input
npm ERR! File: /home/michael/.npm/rimraf/2.2.2/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR! 
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! System Linux 3.8.0-19-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /home/michael
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! file /home/michael/.npm/rimraf/2.2.2/package/package.json
npm ERR! code EJSONPARSE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/michael/npm-debug.log
npm ERR! not ok code 0

The information contained at /home/michael/npm-debug.log is just the standard information contained in the READ.me, which doesn't deal with this problem. Any ideas what might be wrong?

like image 442
Leahcim Avatar asked Dec 25 '22 17:12

Leahcim


1 Answers

Similar issue (osx though) and this solution worked: https://github.com/bower/bower/issues/877.

do: npm cache clean

like image 105
user3066342 Avatar answered Dec 28 '22 07:12

user3066342