【问题标题】:Get error when install node-sqlite3 on windows 8在 Windows 8 上安装 node-sqlite3 时出错
【发布时间】:2013-09-01 18:32:34
【问题描述】:

祝大家有美好的一天!

我的操作系统:WINDOWS 8 安装软件:VS2012 expess, Python 2.7.5, Windows8SDK, node 0.10.17, npm 1.3.8

我收到错误:

C:\Users\sapa\worksapce\node-sqlite3\build\Release\obj\global_intermediate\sqlite-autoconf-3071700\sqlite3.c(606): 致命错误 C1083:无法打开包含文件:'stdarg.h':没有这样的文件 或目录 [C:\Users\sapa\worksapce\node-sqlite3\build\deps\sqlite3.vcxproj]

当我在我的操作系统上安装模块 node-sqlite3 时。 为了安装,我使用了命令 npm install node-sqlite3 并得到了这个错误。之后我使用从源安装:

我从github上克隆了源码https://github.com/developmentseed/node-sqlite3

然后我使用命令 node-gyp configure 并得到了

C:\Users\sapa\worksapce\node-sqlite3>node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@0.10.9
gyp info using node@0.10.17 | win32 | x64
gyp http GET http://nodejs.org/dist/v0.10.17/node-v0.10.17.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.17/node-v0.10.17.tar.gz
gyp http GET http://nodejs.org/dist/v0.10.17/node.lib
gyp http GET http://nodejs.org/dist/v0.10.17/x64/node.lib
gyp http 200 http://nodejs.org/dist/v0.10.17/node.lib
gyp http 200 http://nodejs.org/dist/v0.10.17/x64/node.lib
gyp info spawn python
gyp info spawn args [ 'C:\\Users\\sapa\\AppData\\Roaming\\npm\\node_modules\\nod
e-gyp\\gyp\\gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\sapa\\worksapce\\node-sqlite3\\build\\config.g
ypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\sapa\\AppData\\Roaming\\npm\\node_modules\\nod
e-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\sapa\\.node-gyp\\0.10.17\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\sapa\\.node-gyp\\0.10.17',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\sapa\\worksapce\\node-sqlite
3',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\sapa\\worksapce\\node-sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok

然后node-gyp build得到:

C:\Users\sapa\worksapce\node-sqlite3>node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@0.10.9
gyp info using node@0.10.17 | win32 | x64
gyp info spawn msbuild
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
  unpack_sqlite_dep
  sqlite3.c
C:\Users\sapa\worksapce\node-sqlite3\build\Release\obj\global_intermediate\sqli
te-autoconf-3071700\sqlite3.c(606): fatal error C1083: Cannot open include file
: 'stdarg.h': No such file or directory [C:\Users\sapa\worksapce\node-sqlite3\b
uild\deps\sqlite3.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\sapa\AppData\Roaming\npm\nod
e_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Users\\sapa\\AppData\\Roaming\\npm\\node_modules\\n
ode-gyp\\bin\\node-gyp.js" "build"
gyp ERR! cwd C:\Users\sapa\worksapce\node-sqlite3
gyp ERR! node -v v0.10.17
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok

云你帮我解决这个问题?

【问题讨论】:

    标签: node.js sqlite


    【解决方案1】:

    这样设置,然后试一试: npm config set msvs_version 2012 npm config set python c:/python/python.exe

    【讨论】:

      【解决方案2】:

      您似乎正在尝试构建 64 位安装 (Platform=x64)。 带有 npm install sqlite3 的 32 位节点 v0.10.22 在 Windows 7 上适用于我

      【讨论】:

        猜你喜欢
        • 2018-01-06
        • 2015-04-27
        • 2012-10-18
        • 1970-01-01
        • 2018-02-24
        • 2014-10-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多