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 find module after installing @electron/build-tools on Arch

See original GitHub issue
internal/modules/cjs/loader.js:895
  throw err;
  ^

Error: Cannot find module '/home/ross/.electron_build_tools/src/e'
Require stack:
- /usr/lib/node_modules/@electron/build-tools/run.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:892:15)
    at Function.Module._load (internal/modules/cjs/loader.js:742:27)
    at Module.require (internal/modules/cjs/loader.js:964:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/usr/lib/node_modules/@electron/build-tools/run.js:15:1)
    at Module._compile (internal/modules/cjs/loader.js:1075:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1096:10)
    at Module.load (internal/modules/cjs/loader.js:940:32)
    at Function.Module._load (internal/modules/cjs/loader.js:781:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/lib/node_modules/@electron/build-tools/run.js' ]
}

I just ran npm install -g @electron/build-tools on Arch LInux and got this error after rehashing in zsh and running e init --root=~/electron --bootstrap testing.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
RossComputerGuycommented, Aug 30, 2020

A solution I came up with:

git clone https://github.com/electron/build-tools ~/.electron_build_tools && (cd ~/.electron_build_tools && npm install)
2reactions
kimumetalcommented, Apr 4, 2022

I also suffered this issue. And I found out that

  1. uninstalling build-tools from npm
  2. install yarn
  3. install build-tools again

resolved my issue. If other people confirms that it is resolved by installing yarn, I suggests to modify README.md to state yarn to be ‘must install’ rather than ‘recommend installing’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron-packager: cannot find module - Stack Overflow
Two things you can try: Make sure every node modules that you need to run on production build added into dependencies in package.json....
Read more >
FS#65661 : [ghc-libs] could not find module 'Prelude'; missing ...
FS#65661 - [ghc-libs] could not find module 'Prelude'; missing files in the 'base-4.13.0.0' package. Attached to Project: Community Packages
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >
Xmonad can't find module XMonad - arch linux - Super User
Had the same problem all of a sudden (probably after a system update, but I can't be sure). You might have found some...
Read more >
Npm can't find module "semver" error in Ubuntu 19.04
Repeat until this command returns a blank after node: . sudo apt-get install nodejs; node --version : should return ... no such file...
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