Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"File not found" error for .asar files #18

Open
SHuckel opened this issue Jan 30, 2018 · 6 comments
Open

"File not found" error for .asar files #18

SHuckel opened this issue Jan 30, 2018 · 6 comments

Comments

@SHuckel
Copy link

SHuckel commented Jan 30, 2018

When processing files with .asar file extension, md5-file module reports a "file not found error".

@LinusU
Copy link
Collaborator

LinusU commented Jan 30, 2018

Could you give a minimal code example to reproduce the error?

@SHuckel
Copy link
Author

SHuckel commented Jan 30, 2018

Sure:

require("md5-file")( "/path/to/file.asar", (err, hash) => {
if (err) {
console.log(err);
}
else
console.log(hash);
});

Actually, same error occurs with fs.readFile:

require("fs").readFile("/path/to/file.asar", (err, data) => {
console.log(err);
});

@SHuckel
Copy link
Author

SHuckel commented Jan 30, 2018

Seems to be a known issue:
electron/electron#1658

@SHuckel
Copy link
Author

SHuckel commented Jan 30, 2018

works fine when using:
require("original-fs")

@LinusU
Copy link
Collaborator

LinusU commented Jan 30, 2018

Hmm, I guess that we could add support for passing in a custom fs module, in the same way that the tar module works...

@zardoy
Copy link

zardoy commented Feb 27, 2021

There is no need for that. Just use this line of code:

process.noAsar = true;

Don't use it. It obviously breaks support for app.asar (when its running in production), my bad.

source https://xwartz.gitbooks.io/electron-gitbook/content/en/tutorial/application-packaging.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants