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

How to build for electron. #761

Closed
Wukung1010 opened this issue Jan 9, 2017 · 3 comments
Closed

How to build for electron. #761

Wukung1010 opened this issue Jan 9, 2017 · 3 comments

Comments

@Wukung1010
Copy link

Step:
1.install vs2015
2.install python 2.7
3.install node 6.2
4.npm install -g node-gyp
5.npm install --save electron-rebuild
6.npm install --save --build-from-source sqlite3

Then
can not open file“malloc.h”: No such file or directory[\node_modules\sqlite3\build\deps\sqlite3.vcxproj]

Where did I do wrong? It troubled me for three days.Please help me.

@flash-me
Copy link

flash-me commented Jan 21, 2017

  1. npm install -g node-gyp
  2. Follow the instructions on https://github.com/nodejs/node-gyp
  3. npm install electron-rebuild --save-dev
  4. npm install sqlite3 --save-dev
  5. add to your package.json - scripts following:
    "postinstall": "cd node_modules/sqlite3 && npm install nan && npm run prepublish && node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.4-win32-x64 && node-gyp rebuild --target=1.4.13 --arch=x64 --target_platform=win32 --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.4-win32-x64"
  6. npm run postinstall

Working for me on Windows 10 with:
node: 6.9.2
npm: 4.0.5
electron: 1.4.1
sqlite3: 3.1.8
package.json.zip

@kroggen
Copy link

kroggen commented Feb 24, 2017

Using electron-boilerplate-sqlite:

git clone https://github.com/sjmelia/electron-boilerplate-sqlite
cd electron-boilerplate-sqlite
npm install
npm start

@kurtfusion
Copy link

Installing Electron with Sqlite3 3.1.8 on OSX 10.12

  1. Check that you have the apple developer tools installed.
  2. Check that you pointed to the /usr/bin/libtool, mine pointed to one that wasn't from apples tools so I added the export PATH in the build-sqlite3 script to ensure I point to the correct libtool
  3. Add the script below "build-sqlite3", I also added my dependencies that are working for me.
  4. execute > npm install
  5. execute > sudo npm run build-sqlite3

NOTE: sudo is necessary due to what seems like a permissions bug on something. If you don't run sudo you'll get the following error:

ELECTRON_ASAR.js:173 Uncaught Error: Module version mismatch. Expected 50, got 48.
for OSX:

"scripts": {
"build-sqlite3": "export PATH=/usr/bin:$PATH && cd node_modules/sqlite3 && node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.4-darwin-x64 && node-gyp rebuild --target=1.4.15 --arch=x64 --target_platform=darwin --dist-url=https://atom.io/download/electron --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.4-darwin-x64",
"start": "electron .",
"build": "electron-packager ."
},
"devDependencies": {
"electron": "^1.4.15",
"electron-builder": "^14.4.0",
"electron-rebuild": "^1.5.7"
},
"dependencies": {
"sqlite3": "^3.1.8"
}

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

5 participants