简体   繁体   English

节点Webkit无法安装SQLite3模块

[英]Node Webkit Unable to install SQLite3 Module

I'm very new to Node.JS and Node WebKit. 我是Node.JS和Node WebKit的新手。 I am trying to install the SQLite3 package for Node WebKit by following the instructions that the site has given me 我正在按照网站给我的说明尝试为Node WebKit安装SQLite3软件包

https://github.com/mapbox/node-sqlite3 https://github.com/mapbox/node-sqlite3

I am in my directory with my package.json file 我在我的package.json文件所在的目录中

{
    "name": "First",
    "description": "First attempt",
    "author": "Person",
    "main": "index.html",
    "window": {
        "toolbar": false,
        "width": 600,
        "height": 400
    },
    "license": "ISC"
}

And I did the first required command 我做了第一个必需的命令

npm install nw-gyp -g

which seems to have worked, then I tried to install the SQLite3 Module 这似乎已经奏效,然后我尝试安装SQLite3模块

npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$("0.12.3")

I also tried 我也试过

npm install sqlite3 --runtime=node-webkit --target_arch=x64 --target=0.12.3

But this is failing and the log wasn't terribly helpful 但这是失败的,并且日志并不是很有帮助

2623 verbose pkgid sqlite3@3.1.1
2624 verbose cwd C:\PROG\NodeJS\Programs\NodeWebKit
2625 error Windows_NT 10.0.10586
2626 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sqlite3" "--build-from-source" "--runtime=node-webkit" "--target_arch=ia32" "--target=$(0.12.3)"
2627 error node v4.2.5
2628 error npm  v2.14.12
2629 error code ELIFECYCLE
2630 error sqlite3@3.1.1 install: `node-pre-gyp install --fallback-to-build`
2630 error Exit status 1
2631 error Failed at the sqlite3@3.1.1 install script 'node-pre-gyp install --fallback-to-build'.
2631 error This is most likely a problem with the sqlite3 package,
2631 error not with npm itself.
2631 error Tell the author that this fails on your system:
2631 error     node-pre-gyp install --fallback-to-build
2631 error You can get their info via:
2631 error     npm owner ls sqlite3
2631 error There is likely additional logging output above.
2632 verbose exit [ 1, true ]
2633 verbose unbuild node_modules\sqlite3
2634 info preuninstall sqlite3@3.1.1
2635 info uninstall sqlite3@3.1.1
2636 verbose unbuild rmStuff sqlite3@3.1.1 from C:\PROG\NodeJS\Programs\NodeWebKit\node_modules
2637 info postuninstall sqlite3@3.1.1
2638 silly gentlyRm C:\PROG\NodeJS\Programs\NodeWebKit\node_modules\sqlite3 is being purged from base C:\PROG\NodeJS\Programs\NodeWebKit
2639 verbose gentlyRm don't care about contents; nuking C:\PROG\NodeJS\Programs\NodeWebKit\node_modules\sqlite3
2640 silly vacuum-fs purging C:\PROG\NodeJS\Programs\NodeWebKit\node_modules\sqlite3
2641 silly vacuum-fs removing C:\PROG\NodeJS\Programs\NodeWebKit\node_modules
2642 silly vacuum-fs finished vacuuming up to C:\PROG\NodeJS\Programs\NodeWebKit

Where do I start attempting to resolve this 我从哪里开始尝试解决此问题

UPDATE 更新

This problem may be related to the nw-gyp. 此问题可能与nw-gyp有关。 I ran 我跑了

npm install nw-gyp -g

Which seemed ok but if I try to use it then I get an error, if I run 看起来还可以,但是如果我尝试使用它,那么运行时会出现错误

nw-gyp configure --target=0.12.3

I get an error 我得到一个错误

'nw-gyp' is not recognized as an internal or external command, operable program or batch file

UPDATE 02 更新02

I'm going to Install Visual Studio Express to see if this fixes it. 我将安装Visual Studio Express,以查看是否可以解决此问题。 This may take a long time 这可能需要很长时间

I ran into similar problems as you did and I could fix it by doing the following. 我遇到了与您类似的问题,可以通过以下操作来解决。

Install Visual Studio Express 2012 or 2010. Afterwards Install Python and make sure that you set the build path. 安装Visual Studio Express 2012或2010。之后安装Python并确保设置了构建路径。 There is usually a option asking you to set the for you, if you use the installer. 如果使用安装程序,通常会有一个选项要求您设置。

Use the following command to install SQLite 使用以下命令安装SQLite

npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target="0.12.3" --save

Don't forget the --save as it will save the installation to your package.json. 不要忘记--save ,因为它将保存安装到您的package.json中。 This is necessary for node-webkit to find it. 这是node-webkit找到它所必需的。

UPDATE With echo %PATH% in cmd you can see your path. 更新在cmd中使用echo %PATH%可以看到您的路径。 Adding Python would look like this set PYTHONPATH=%PYTHONPATH%;C:\\My_python_lib Depending on where you installed python 添加Python看起来像这样: set PYTHONPATH=%PYTHONPATH%;C:\\My_python_lib取决于安装python的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM