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

BUG: asar command fails with "module not found" #295

Closed
RobertBouillon opened this issue Dec 31, 2023 · 2 comments
Closed

BUG: asar command fails with "module not found" #295

RobertBouillon opened this issue Dec 31, 2023 · 2 comments

Comments

@RobertBouillon
Copy link

RobertBouillon commented Dec 31, 2023

Description

Using asar command-line utility on windows fails with "Cannot find module".

Environment

Steps to Reproduce

  • Install electron using npm install @electron
  • Install asar using npm install @electron\asar
  • Run the command .\node_modules\.bin\asar

Expected Results

No output or error message

Actual Results

Receive the following error message:

node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module 'C:\...\Source\node_modules\@electron\asar\bin\asar.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Workaround

Download the ajar.js file from the repo to the node_modules\@electron\asar\bin\ folder.

@erikian
Copy link
Member

erikian commented Jan 10, 2024

Sounds like your installation is just corrupted, have you tried deleting node_modules and running npm install again?

@RobertBouillon
Copy link
Author

Problem was on my end. Thanks for the help!

@erikian erikian closed this as completed Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants