当我尝试安装
requirejs-text
时,出现了一个我不理解的错误。$ bower install requirejs-text
bower EMALFORMED Failed to read /Users/bgolder/projects/explorer/front/bower.json
Additional error details:
Unexpected string
在bower.json文件中,我没有发现任何问题。
{
"name": "front",
"version": "0.0.0",
"dependencies": {
"bootstrap": "~3.1.1"
"jquery": "~1.10.2",
"requirejs": "~2.1.9",
"requirejs-text": "~2.0.10",
"underscore": "~1.5.2",
"backbone": "~1.1.0",
"modernizr": "~2.6.2"
},
"devDependencies": {},
}
如果我在bower上使用冗长选项,我会得到这个跟踪。
bower EMALFORMED Failed to read /Users/bgolder/projects/explorer/front/bower.json
Additional error details:
Unexpected string
Stack trace:
SyntaxError: Unexpected string
at Object.parse (native)
at /usr/local/lib/node_modules/bower/node_modules/bower-json/lib/json.js:41:29
at fs.js:266:14
at /usr/local/lib/node_modules/bower/node_modules/graceful-fs/graceful-fs.js:104:5
at Object.oncomplete (fs.js:107:15)
From previous event:
at readJson (/usr/local/lib/node_modules/bower/lib/util/readJson.js:17:6)
at Project._readJson (/usr/local/lib/node_modules/bower/lib/core/Project.js:539:25)
at Project._analyse (/usr/local/lib/node_modules/bower/lib/core/Project.js:445:14)
at Project.install (/usr/local/lib/node_modules/bower/lib/core/Project.js:47:17)
Console trace:
Trace
at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:74:17)
at Logger.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:114:22)
at Logger.EventEmitter.emit (events.js:95:17)
at Logger.emit (/usr/local/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /usr/local/lib/node_modules/bower/lib/commands/install.js:35:16
at _rejected (/usr/local/lib/node_modules/bower/node_modules/q/q.js:797:24)
at /usr/local/lib/node_modules/bower/node_modules/q/q.js:823:30
at Promise.when (/usr/local/lib/node_modules/bower/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/node_modules/q/q.js:741:41)
at /usr/local/lib/node_modules/bower/node_modules/q/q.js:557:44
System info:
Bower version: 1.3.1
Node version: 0.10.26
OS: Darwin 13.1.0 x64
这仍然没有解释出问题所在。