question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot load native extension when using asar

See original GitHub issue

ELECTRON_ASAR.js:158 Uncaught Error: The specified module could not be found. ?\C:\Users<User Name>\AppData\Local\Temp<RANDOM>.tmp.node

And I can found it in this path…

I think the \\?\ is unnecessary…

It appears only when I use this option --asar=true

Which version of electron-packager are you using?

7.3.0

What CLI arguments are you passing? Alternatively, if you are using the API, what parameters are you passing to the packager() function?

electron-packager . “VizMusicPlayer” --out=dist/win --platform=win32 --arch=x64 --version=1.2.7 --icon=build/icon.ico --asar=true

What version of Electron are you building with?

1.2.7

What is the host platform are you running electron-packager on?

Windows 10 x64

What target platform(s)/architecture(s) are you building for?

Windows x64

Is there a stack trace in the error message you’re seeing?

(RUNTIME, Electron Renderer Process)

ELECTRON_ASAR.js:158
Uncaught Error: The specified module could not be found.
\\?\C:\Users\<User Name>\AppData\Local\Temp\<RANDOM>.tmp.node

Please provide either a failing testcase or detailed steps to reproduce your problem.

https://github.com/VizMusicPlayer/VizMusicPlayer

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
Joeancacommented, Sep 17, 2018

After much searching and reading documentation --asar.unpack=*.{node,dll} on the electron-packager cli did the trick for me. Make sure you are rebuilding sharp as required before packaging.

2reactions
vuamitomcommented, Dec 22, 2017

Please note that this same error can be thrown if dll dependencies are not found for the native node module.

Details are in last comment on

electron/asar#129

Read more comments on GitHub >

github_iconTop Results From Across the Web

meteor - Electron packaging - ASAR file error - Stack Overflow
Show activity on this post. I am packaging a Meteor app using Electrify (by extension the Electron-Packager). Since the node module paths are...
Read more >
electron-builder
A complete solution to package and build a ready for distribution Electron app for macOS, Windows and Linux with “auto update” support out...
Read more >
electron/js2c/asar.js:140 | The AI Search Engine You Control
I extract the asar files manually before pack and distribute my app and the problem gone. Is a bit tedious, but is the...
Read more >
Native Node Modules | Electron
When in doubt, run electron-rebuild first. Make sure the native module is compatible with the target platform and architecture for your Electron app....
Read more >
Electron package guidelines - ArchWiki
Some electron applications have compiled native extensions which link ... This might not be desired if you want to use the system electron ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found