Node.js 无法安装节点postgres

Node.js 无法安装节点postgres,node.js,postgresql,node-postgres,Node.js,Postgresql,Node Postgres,我正在尝试为我的项目设置节点postgres。然而,当我尝试安装它时,我不断地得到这些gyp错误。如何让节点postgres识别我的pg_配置位于/Library/PostgreSQL/9.3/bin/pg_配置中。因为我最喜欢的搜索引擎结果告诉我这样做: ➜ src git:(master) ✗ PG_CONFIG=/Library/PostgreSQL/9.3/bin/pg_config ➜ src git:(master) ✗ export PG_CONFIG ➜ src git:(

我正在尝试为我的项目设置节点postgres。然而,当我尝试安装它时,我不断地得到这些gyp错误。如何让节点postgres识别我的pg_配置位于/Library/PostgreSQL/9.3/bin/pg_配置中。因为我最喜欢的搜索引擎结果告诉我这样做:

➜  src git:(master) ✗ PG_CONFIG=/Library/PostgreSQL/9.3/bin/pg_config
➜  src git:(master) ✗ export PG_CONFIG
➜  src git:(master) ✗ sudo npm install pg
Password:
npm WARN package.json test@0.1.0 No repository field.
npm http GET https://registry.npmjs.org/pg
npm http 304 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/generic-pool/2.0.3
npm http GET https://registry.npmjs.org/buffer-writer/1.0.0
npm http GET https://registry.npmjs.org/pgpass/0.0.1
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/pgpass/0.0.1
npm http 304 https://registry.npmjs.org/buffer-writer/1.0.0
npm http 304 https://registry.npmjs.org/generic-pool/2.0.3
npm http GET https://registry.npmjs.org/split
npm http 304 https://registry.npmjs.org/split
npm http GET https://registry.npmjs.org/through
npm http 304 https://registry.npmjs.org/through

> pg@2.11.1 install /Users/me/test/src/node_modules/pg
> node-gyp rebuild || (exit 0)

/bin/sh: pg_config: command not found
gyp: Call to 'pg_config --libdir' returned exit status 127.
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:337:16)
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 Darwin 13.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/me/test/src/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)
➜  src git:(master) ✗

节点构建工具似乎没有查看
PG_CONFIG
env变量:

/bin/sh:pg_config:未找到命令

将其添加到路径:

export PATH=/Library/PostgreSQL/9.3/bin:$PATH

你真棒!看来我还得进一步挖掘这些导出路径;我就是不明白他们的意思purpose@Egidius如果命令位于路径上,则可以在不指定完整路径的情况下运行该命令。因此
/bin/ls
可以简单地作为
ls
运行,因为
/bin
位于
路径上。这被工具链、编译/配置脚本等用来发现可以安装在系统任何地方的东西的位置。我在开发环境中的工作流中遇到了这个错误,“直接涉及编程或编程工具”,所以根本不离题!