Sqlite3 v3或v4无法与Electron v3一起安装

时间:2018-10-08 16:59:43

标签: javascript node.js sqlite electron node-gyp

我正在尝试在我的Electron应用程序上运行SQLite,但是失败了。这是我当前的设置:

  • 节点8.10
  • OSX 10.13.3
  • NPM 6.4.1
  • Electron 3.0.3
  • Python 2.7

Traceback (most recent call last): File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 12, in <module> sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib')) AttributeError: 'module' object has no attribute 'path' gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Darwin 17.4.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/user/Downloads/AngularElectron2-master/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/user/Downloads/AngularElectron2-master/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64" "--dist-url=https://atom.io/download/electron"

我尝试进行electron-rebuild并安装了节点gyp,但是某些操作不起作用,并且我不知道如何解释错误消息。

我尝试过:

  1. 使用纱线而不是npm卸下并重新安装node_modules
  2. --runtime=electron --target=1.7.6 --dist-url=https://atom.io/download/electron
  3. --runtime=electron --target=3.0.3 --dist-url=https://atom.io/download/electron
  4. npm install --build-from-source
  5. 删除~./node-gyp

该项目在Windows 7x64上运行正常

0 个答案:

没有答案