asar icon indicating copy to clipboard operation
asar copied to clipboard

[windows] "RangeError: Out of the range index" when the package is only one file, and file size less than 100 bytes

Open gaosiming opened this issue 8 years ago • 10 comments

[windows] "RangeError: Out of the range index" when the package is only one file, and file size less than 100 bytes

resources >> New Text Document.txt

In "new text document. TXT", there are one hundred characters "a", then run the pack command, work fine, But is there a error in 99 characters "a"

command as > asar p .\resources app.asar

RangeError: Out of range index
    at Buffer.fill (buffer.js:703:11)
    at Pickle.writeBytes (x:\code\electron_src\electron\node_modules\chromium-pickle-js\lib\pickle.js:197:19)
    at Pickle.writeString (x:\code\electron_src\electron\node_modules\chromium-pickle-js\lib\pickle.js:173:19)
    at Object.module.exports.writeFilesystem (x:\code\electron_src\electron\node_modules\asar\lib\disk.js:60:20)
    at x:\code\electron_src\electron\node_modules\asar\lib\asar.js:155:19
    at x:\code\electron_src\electron\node_modules\mkdirp\index.js:48:26
    at FSReqWrap.oncomplete (fs.js:123:15)

gaosiming avatar Mar 24 '17 11:03 gaosiming

I run into this issue too. Here Github Desktop you can download the linux AppImage, and try to unpack the asar, you can reproduce this.

gengjiawen avatar Jun 03 '17 02:06 gengjiawen

I tried linux (Ubuntu 17.04) too, still not working.

buffer.js:851
    throw new RangeError('Index out of range');
    ^

RangeError: Index out of range
    at checkOffset (buffer.js:851:11)
    at Buffer.readUInt32LE (buffer.js:913:5)
    at Pickle.getPayloadSize (/usr/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:192:24)
    at new PickleIterator (/usr/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:27:28)
    at Pickle.createIterator (/usr/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:144:12)
    at Object.module.exports.readArchiveHeaderSync (/usr/lib/node_modules/asar/lib/disk.js:81:23)
    at Object.module.exports.readFilesystemSync (/usr/lib/node_modules/asar/lib/disk.js:97:25)
    at Object.module.exports.extractAll (/usr/lib/node_modules/asar/lib/asar.js:183:27)
    at Command.<anonymous> (/usr/lib/node_modules/asar/bin/asar.js:60:15)
    at Command.listener (/usr/lib/node_modules/asar/node_modules/commander/index.js:301:8)

gengjiawen avatar Jun 03 '17 03:06 gengjiawen

I tried macOS, and it works...

gengjiawen avatar Jun 03 '17 12:06 gengjiawen

I tried macOS, it does not work....

acrazing avatar Apr 03 '18 09:04 acrazing

I tried to extract app.asar file of Cocos Creator 1.8.2 in /Applications/CocosCreator.app/Contents/Resources/app.asar and got this error message.

aztack avatar May 15 '18 03:05 aztack

+1

ghost avatar Jun 24 '18 10:06 ghost

I tried to extract app.asar on macOS, got this error message too

fengzhike avatar May 07 '19 10:05 fengzhike

facing the same issue here on a windows 10 machine, does this need a specific version of node or asar to successfully unpack?

hussainb avatar May 23 '19 17:05 hussainb

I tried to extract app.asar file of Cocos Creator 1.8.2 in /Applications/CocosCreator.app/Contents/Resources/app.asar and got this error message.

I extracted app.asar with 7-zip+asar.dll To my surprise, it contains two binary files: app.x64 and app.x86 🤣

aztack avatar Jun 11 '19 09:06 aztack

在Windows 10计算机上面临同样的问题,这是否需要特定版本的节点或asar才能成功解压缩?

thorn5918 avatar Nov 11 '19 10:11 thorn5918