如何解决npm bower安装错误?

时间:2015-09-18 10:27:39

标签: node.js npm bower bower-install

ipriyan@iPriyan:~$ sudo npm install -g bower

嗨,我尝试通过上面的命令安装bower但是我收到以下错误。

npm ERR! Linux 3.19.0-28-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! file /home/ipriyan/.npm/node-uuid/1.4.3/package/package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! No data, empty input at 1:1
npm ERR! 
npm ERR! ^
npm ERR! File: /home/ipriyan/.npm/node-uuid/1.4.3/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! Please include the following file with any support request:
npm ERR!     /home/ipriyan/npm-debug.log

如何解决这个问题? 我使用的是14.04 Ubuntu 64位操作系统 感谢

1 个答案:

答案 0 :(得分:0)

您的package.json文件似乎有问题。请仔细检查一下。您也可以使用此命令来修复它:

node package.json