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

failed to run on ubuntu #41

Closed
marawannwh opened this issue Dec 29, 2015 · 5 comments
Closed

failed to run on ubuntu #41

marawannwh opened this issue Dec 29, 2015 · 5 comments

Comments

@marawannwh
Copy link

i get this when i run "electron ."

[10282:1229/111606:ERROR:browser_main_loop.cc(173)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
[10322:1229/111611:INFO:renderer_main.cc(200)] Renderer process started
null
[10282:1229/111614:INFO:CONSOLE(109)] "Download the React DevTools for a better development experience: https://fb.me/react-devtools", source: /home/marwan/sqltabs/node_modules/react/lib/React.js (109)
[10282:1229/111615:INFO:CONSOLE(83)] "Uncaught Error: Module did not self-register.", source: /home/marwan/sqltabs/node_modules/libpq/node_modules/bindings/bindings.js (83)

and the application just opens in an empty window

@sasha-alias
Copy link
Owner

The error means it failed to import libpq driver which is C-compiled so depends on platform architecture. Do you have 32bit or 64bit version of Ubuntu? The available build is only for x64

@marawannwh
Copy link
Author

64bit

sudo apt-get install libpq-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libpq-dev is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-63 linux-headers-3.13.0-63-generic
  linux-image-3.13.0-63-generic linux-image-extra-3.13.0-63-generic
  python-wicd wicd-daemon
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.

@sasha-alias
Copy link
Owner

Something went wrong during compilation of libpq binding.
Check the electron version you have, should be 0.27.3:

$ electron --version
[2769:1229/143739:ERROR:browser_main_loop.cc(173)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
v0.27.3

If version is OK try to recompile libpq binding:

rm -rf node_modules/libpq/
export npm_config_disturl=https://atom.io/download/atom-shell
export npm_config_target=0.27.3
export npm_config_arch=x64
export npm_config_runtime=electron
npm install git+https://github.com/sasha-alias/node-libpq.git

Expected output would be smth like:

npm WARN package.json microevent@1.0.0 No repository field.
npm WARN package.json sqldoc@0.3.0 No repository field.
npm http GET https://registry.npmjs.org/bindings/1.2.1
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings/1.2.1

> libpq@1.6.4 install /home/alp/sqltabs/node_modules/libpq
> node-gyp rebuild

make: Entering directory `/home/alp/sqltabs/node_modules/libpq/build'
  CXX(target) Release/obj.target/addon/src/connection.o
  CXX(target) Release/obj.target/addon/src/connect-async-worker.o
  CXX(target) Release/obj.target/addon/src/addon.o
  SOLINK_MODULE(target) Release/obj.target/addon.node
  SOLINK_MODULE(target) Release/obj.target/addon.node: Finished
  COPY Release/addon.node
make: Leaving directory `/home/alp/sqltabs/node_modules/libpq/build'
npm WARN unmet dependency /home/alp/sqltabs/node_modules/c3 requires d3@'<=3.5.0' but will load
npm WARN unmet dependency /home/alp/sqltabs/node_modules/d3,
npm WARN unmet dependency which is version 3.5.12
libpq@1.6.4 node_modules/libpq
├── bindings@1.2.1
└── nan@1.9.0

If the compilation fails ensure you have picked by your shell the environment variables npm_config_disturl, npm_config_target, npm_config_arch, npm_config_runtime.
just echo them:

$ echo $npm_config_target 
0.27.3

Also ensure you have pg_config from libpq-dev package installed and accessible in your PATH:

$ pg_config --version
PostgreSQL 9.3.10

@marawannwh
Copy link
Author

it worked, i don't know what was wrong
i did libpq recompiling, and used bash instead of fish

thanks, great app

@sasha-alias
Copy link
Owner

fish has a different way of setting environment variables, it's not fully bash compatible so instead of
export you should use set command.

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

No branches or pull requests

2 participants