asar icon indicating copy to clipboard operation
asar copied to clipboard

asar fs.readFileSync() fails with Error: ENOENT on macOs Sierra

Open pgavazzi opened this issue 8 years ago • 1 comments

While using instanbul in my Electron process, I get this error:

A JavaScript error occurred in the main process Uncaught Exception: Error: ENOENT, browser/api/app.js not found in /Users/paolo/unity/unityeditor-hub/Unity-darwin-x64/Unity.app/Contents/Resources/electron.asar at notFoundError (ELECTRON_ASAR.js:110:19) at Object.fs.readFileSync (ELECTRON_ASAR.js:509:9) at /Users/paolo/unity/unityeditor-hub/node_modules/istanbul/lib/command/common/run-with-cover.js:224:48 at Array.forEach (native) at process.<anonymous> (/Users/paolo/unity/unityeditor-hub/node_modules/istanbul/lib/command/common/run-with-cover.js:222:39) at process.g (events.js:286:16) at emitOne (events.js:101:20) at process.emit (events.js:188:7) at App.<anonymous> (/Users/paolo/unity/unityeditor-hub/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/browser/init.js:64:11) at emitTwo (events.js:106:13)

even if I run the asar cli command shows that the file exists!

$asar list /Users/paolo/unity/unityeditor-hub/Unity-darwin-x64/Unity.app/Contents/Resources/electron.asar /browser /browser/api /browser/api/app.js

Anybody ran into this issue? Same npm test runs perfectly on os X El Capitan

pgavazzi avatar Oct 12 '16 18:10 pgavazzi

I'm getting this problem too. Trying to (simplified):

execFile(`dir/bar/foo`, [], function(err) {
  if (err) throw err;
  console.log('started program foo');
});

If I unpack the app.asar I see the dir/bar/foo.

Seems like #25 may solve this... digging

andrewjaykeller avatar Jan 02 '17 17:01 andrewjaykeller