我上传了一个bower组件作为tar文件,即使我知道它是一个有效的tar文件,但在运行bower install时,我收到以下错误:
bower my-component#* error invalid tar file
Stack trace: Error: invalid tar file
at Extract.Parse._startEntry (/usr/local/lib/node_modules/bower/node_modules/tar/lib/parse.js:144:13)
at Extract.Parse._process (/usr/local/lib/node_modules/bower/node_modules/tar/lib/parse.js:125:12)
at BlockStream.<anonymous> (/usr/local/lib/node_modules/bower/node_modules/tar/lib/parse.js:46:8)
at BlockStream.EventEmitter.emit (events.js:95:17)
at BlockStream._emitChunk (/usr/local/lib/node_modules/bower/node_modules/tar/node_modules/block-stream/block-stream.js:145:10)
at BlockStream.resume (/usr/local/lib/node_modules/bower/node_modules/tar/node_modules/block-stream/block-stream.js:58:15)
at Extract.Reader.resume (/usr/local/lib/node_modules/bower/node_modules/fstream/lib/reader.js:253:34)
at Entry.<anonymous> (/usr/local/lib/node_modules/bower/node_modules/tar/lib/parse.js:256:8)
at Entry.EventEmitter.emit (events.js:92:17)
at Entry.resume (/usr/local/lib/node_modules/bower/node_modules/tar/lib/entry.js:92:8)
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:807:24)
at /usr/local/lib/node_modules/bower/node_modules/q/q.js:833:30
at Promise.when (/usr/local/lib/node_modules/bower/node_modules/q/q.js:1077:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/node_modules/q/q.js:751:41)
at /usr/local/lib/node_modules/bower/node_modules/q/q.js:573:44
System info: Bower version:
1.3.0 Node version: 0.10.26
OS: Linux 2.6.32-5-amd64 x64
我已经检查过以相同方式上传的其他tar文件,它们看起来和我的一样。 想法?
答案 0 :(得分:1)
问题是tar文件的版本。我使用Maven插件创建了tar文件:maven-assembly-plugin,但没有指定版本。但是在将版本设置为2.4后它才起作用。