question about bower tutorial

November 26, 2013 2.4k views
When I try to run the command npm install -g bower from this Bower tutorail I get the errors you see below. Any ideas what the problem might be? npm http 304 npm http 304 npm http 304 npm http 304 npm http 304 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
1 comment
  • Hi, I'm doing the same thing, but it still doesn't work when trying to install bower. It just doesn't do anything. I have node 0.12.7 version installed. Thank's in advance!

3 Answers
Try clearing npm's cache:
mv /home/michael/.npm /home/michael/.npm.backup

And then run npm install -g bower again, does that work?

If not, what's the output of
node -v
Clearing the cache did the trick. Thanks.

Node v0.10.22
Have another answer? Share your knowledge.