Browser-laptop: Cannot find module 'ad-block'

Created on 10 Jun 2017  Â·  12Comments  Â·  Source: brave/browser-laptop

  • Did you search for similar issues before submitting this one?
    yes, similar issues exist but their solutions (upgrade node and node-gyp) do not solve the problem.

  • Describe the issue you encountered:
    When launching from source, fails to find ad-block

  • Platform (Win7, 8, 10? macOS? Linux distro?):
    Slackware Linux 14.2

Brave Version (revision SHA):
$ git log --oneline | head -n 1
d66351b Merge pull request #9374 from brave/exit-signals

$ node --version  
v6.10.3

$ npm list node-gyp
[email protected] /home/klaatu/src/brave.clone
'-- [email protected]
  • Steps to reproduce:

    1. git clone blah blah
    2. npm install
    3. node ./tools/start.js --user-data-dir=brave-development --enable-logging --v=2 --enable-extension-activity-logging --enable-sandbox-logging --enable-dcheck
  • Actual result:

App threw an error during load

    Error: Cannot find module 'ad-block'
    at Module._resolveFilename (module.js:455:15)
    at Function.Module._resolveFilename (/usr/share/electron/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/sek/src/brave.clone/app/adBlock.js:8:49)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    An uncaught exception occurred in the main process Uncaught Exception:
    Error: Cannot find module 'ad-block'
    at Module._resolveFilename (module.js:455:15)
    at Function.Module._resolveFilename (/usr/share/electron/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/sek/src/brave.clone/app/adBlock.js:8:49)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    Waiting 60 seconds for process to load
  • Expected result:
    Brave should launch.

  • Will the steps above reproduce in a fresh profile? If not what other info can be added?
    Yes.

  • Is this an issue in the currently released version?
    Probably not.

  • Can this issue be consistently reproduced?
    Yes.

Ounix-liklinux bug dev-setup

Most helpful comment

I'll be removing ad-block and tracking-protection out of browser-laptop and into muon probably within a couple weeks.

All 12 comments

CC @bbondy

@notklaatu did the npm install finish without any errors? (ex: what was the return value? try echo $? after it finishes)

I got some warnings about some deps that are impossible to fulfill (win version of 7zip, although I do have p7zip installed) and some other things, but otherwise it looked OK. I reran it, here's the tail:

                   webtorrentPage.entry.js    1.39 MB       0  [emitted]  main
               webtorrentPage.entry.js.map    1.71 MB       0  [emitted]  main
       [0] multi main 28 bytes {0} [built]
        + 315 hidden modules
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@^1.0.1 (node_modules/7zip-bin/node_modules/7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-win@^2.1.0 (node_modules/7zip-bin/node_modules/7zip-bin-win):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

bash-4.3$ echo $?
0

I had to run npm install a couple of times as admin on windows to get this to work, also run npm install --save-dev electron-prebuilt

I tried npm install save-dev and electron-prebuilt, no luck.

Attached is an strace on node ./tools/start.js --user-data-dir=brave-development --enable-logging --v=2 --enable-extension-activity-logging --enable-sandbox-logging --enable-dcheck

Try - - save and send the error on npm install. Make sure you run as admin

On Thu, 15 Jun 2017, 04:09 notklaatu, notifications@github.com wrote:

Attached is an strace on node ./tools/start.js
--user-data-dir=brave-development --enable-logging --v=2
--enable-extension-activity-logging --enable-sandbox-logging --enable-dcheck

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/brave/browser-laptop/issues/9381#issuecomment-308616230,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQLE3A_k7WwtV80dr0kAHg8hfy9TJ85Bks5sEKB0gaJpZM4N2C7o
.

>

Regards,
[image: photo]
Alessandro Giordo
Web Developer
Mobile: 074 5609 9967 <+447456099967> | Email: Contact Me
bovas85@gmail.com
https://www.linkedin.com/in/agiordo/
https://www.linkedin.com/in/agiordo/

https://twitter.com/@moustacheDsign http://twitter.com/@moustacheDsign
​Github https://github.com/bovas85 - CodePen
http://codepen.io/leelium/ - Website https://moustachedesign.xyz/

$ npm install --save

renders no errors, except the one about ad-block in my original bug report (or comment, whatever they're called in Github).

mind trying with rm -rf node_modules && rm -rf ~/.electron && npm i after updating node to 7.9.0 or later?

I'll be removing ad-block and tracking-protection out of browser-laptop and into muon probably within a couple weeks.

Just installed Brave from the Fedora RPM on Slackware64, works perfectly. No more errors.

Thanks!

Brave | 0.18.36
rev | 7ab85e9
Muon | 4.3.22
libchromiumcontent | 61.0.3163.79
V8 | 6.1.534.32
Node.js | 7.9.0
Update Channel | dev
OS Platform | Linux
OS Release | 4.4.14
OS Architecture | x64

(posted from Brave)

Moving ad-block and tracking-protection to muon is done and just needs a merge and a build. Once we do that we can close this and also simplify setup steps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonathansampson picture jonathansampson  Â·  3Comments

luixxiul picture luixxiul  Â·  3Comments

stevespringett picture stevespringett  Â·  3Comments

bbondy picture bbondy  Â·  3Comments

eljuno picture eljuno  Â·  3Comments