Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Javascript error after build #209

Closed
timothytavarez opened this issue Jan 20, 2016 · 10 comments · Fixed by #236
Closed

Javascript error after build #209

timothytavarez opened this issue Jan 20, 2016 · 10 comments · Fixed by #236

Comments

@timothytavarez
Copy link

screen shot 2016-01-20 at 12 59 59 pm

OS X 10.11.1

Performed clone from repo, installed via NPM (no errors, I think), created .app and then built the .dmg - but no dice.

Do I just repeat the install/build process?

Uncaught Exception: Error: Cannot find module '/Applications/Brave.app/Contents/Resources/app/node_modules/sqlite3/lib/binding/node-v47-darwin-x64/node_sqlite3.node' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:289:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Object.<anonymous> (/Applications/Brave.app/Contents/Resources/app/node_modules/sqlite3/lib/sqlite3.js:4:15) at Module._compile (module.js:425:26) at Object.Module._extensions..js (module.js:432:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:313:12) at Module.require (module.js:366:17)

@bbondy
Copy link
Member

bbondy commented Jan 20, 2016

Did you npm install already? Also please ensure you have the latest node install (v5)

@brakmic
Copy link

brakmic commented Jan 20, 2016

Same here, on Win 10 x64, with node 5.4.1

err

@tomru
Copy link

tomru commented Jan 20, 2016

Experienced the same issue on Linux with node 4.x.

After switching to node 5.4.1, removing node_modules folder and another npm install the issue was solved for me.

@bbondy
Copy link
Member

bbondy commented Jan 20, 2016

@tomru almost definitely the issue, thanks.

Likely people npm installed with 0.12 or similar and then upgraded. We use 3 native modules currently for fast tracking protection, adblock and https everywhere (which uses sqlite). Those need to be built with 5.4.1.

A faster solution may be to just run the postinstall which re-builds these native modules:

npm run postinstall

@bobpoekert
Copy link

I ran npm run postinstall, and it printed a bunch of stuff about sqlite3 when it was running, but after running npm run build-darwin and launching the .app I still got the error.

screen shot 2016-01-20 at 2 33 42 pm

@bbondy
Copy link
Member

bbondy commented Jan 21, 2016

@bobpoekert can you confirm if you're on Node 5.5? If so, please make sure you clear out your node_modules directory first and then npm install.

@qbig
Copy link

qbig commented Jan 21, 2016

@bbondy bbondy #221 seems to have the same symptom. Confirm running 5.5. tried 'rm -rf node_modules' before npm install

@epu
Copy link

epu commented Jan 21, 2016

Hit this on El Capitan with old node 4. Upgrading to confirm. If this is an issue, can we mention node version constraint / requirement in readme, and/or assert during build?

elia added a commit to elia/browser-laptop that referenced this issue Jan 22, 2016
elia added a commit to elia/browser-laptop that referenced this issue Jan 22, 2016
@bbondy
Copy link
Member

bbondy commented Jan 22, 2016

Hit this on El Capitan with old node 4. Upgrading to confirm. If this is an issue, can we mention node version constraint / requirement in readme, and/or assert during build?

Yep that's merged now in the README.

@epu
Copy link

epu commented Jan 22, 2016

This fixed it for me, but I also had to clear out the npm cache manually, and set my new npm to be first in my PATH. Evoking the new npm via its fq path was not enough.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants