isaacs/rimraf

unable to delete asar file

midnight1994 opened this issue · 3 comments

rimraf('/path/app.asar', function (err) { if (err) { throw err } console.log('success') })
The prompt was successful, but the asar file was not deleted. How can I solve this problem?

I tried to run the same code. rimraf was successfully able to delete asar file.
My code reference here
It is working fine. Probably you can try upgrading rimraf or re-installing it again.

A workaround I discovered. I renamed app.asar to appasar and ran rimraf against appasar. That worked.

by default electron will try to process .asar files, activating this flag process.noAsar = true; will be treating an asar archive as a normal file,

you can this only when using rimfar for example

process.noAsar = true;
rimraf(somePath, (err) => {
   process.noAsar = false;
  //....
});