【发布时间】: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)
【问题讨论】:
-
阅读 Windows 的安装说明。确保
pg_config(可执行文件)在PATH上。确保已安装 PostgreSQL。
标签: node.js postgresql