【问题标题】:Installation on nodej.js pg module issue (Cannot open include file: 'pg_config.h')安装 node.js pg 模块问题(无法打开包含文件:'pg_config.h')
【发布时间】:2014-07-27 11:48:15
【问题描述】:

在 Windows 上安装 pg 模块时,我可以解决这个问题:

c:\Program Files (x86)\nodejs\node_modules\pg>node "c:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node
  -gyp\bin\node-gyp.js" rebuild
  binding.cc
  ..\src\binding.cc(1): fatal error C1083: Cannot open include file: 'pg_config.h': No such file or directory [c:\Program Files (x86)\nodejs\
  node_modules\pg\build\binding.vcxproj]
  gyp ERR! build error
  gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
  gyp ERR! stack     at ChildProcess.onExit (c:\Program Files (x86)\nodejs\node_modules\npm\node_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.1.7601
  gyp ERR! command "node" "c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
  gyp ERR! cwd c:\Program Files (x86)\nodejs\node_modules\pg
  gyp ERR! node -v v0.10.24
  gyp ERR! node-gyp -v v0.12.1
  gyp ERR! not ok
  pg@2.11.1 node_modules\pg
  ├── nan@0.6.0
  ├── generic-pool@2.0.3
  ├── buffer-writer@1.0.0
  └── pgpass@0.0.1 (split@0.2.10)

【问题讨论】:

标签: node.js postgresql


【解决方案1】:

我的环境:

win - 8.1
vs - 2012
pg - 9.3
nodejs - 0.10.29
npm - 1.4.14

pg 路径 "D:\Program Files\PostgreSQL\9.3\bin" 已手动添加到系统环境变量“PATH”中。

我遇到了同样的错误,并注意到\pg\build\binding.vcxproj 文件中的路径是D:\Program;..\Files\PostgreSQL\9.3\include\;...

所以 pg 路径中​​的空间可能是问题所在。更改pg安装路径后,问题解决。

【讨论】:

    猜你喜欢
    • 2014-05-24
    • 1970-01-01
    • 2019-07-09
    • 2015-01-08
    • 2018-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多