저는 node.js가 매우 새로 도입되었으며, 서버 측 구성 및 코딩과 관련하여 상당히 초록색입니다. (저는 오랫동안 클라이언트 측 프로그래밍의 오랜 역사를 가지고 있습니다. 최근에는 Adobe Flex와 ActionScript를 사용했습니다.)node-postgres 모듈을 node.js 용으로 설치할 때 빌드가 실패했습니다.
아무튼 나는 Linux 서버를 관리하는 Rackspace에게 node.js와 node-postgres를 설치하도록 요청했습니다.
이
Running Transaction
Installing : nodejs-stable-release [1/1]
Installed: nodejs-stable-release.noarch 0:5-3
Complete!
Node.js를 노드 - 포스트 그레스
[[email protected] src]# npm install pg
npm http GET https://registry.npmjs.org/pg
npm http 200 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/pg/-/pg-0.6.17.tgz
npm http GET https://registry.npmjs.org/generic-pool/1.0.9
npm http 200 https://registry.npmjs.org/generic-pool/1.0.9
npm http GET https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.9.tgz
[email protected] install /usr/src/node_modules/pg
node-waf configure build || (exit 0)
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr
Checking for program pg_config : /usr/bin/pg_config
'configure' finished successfully (0.051s)
Waf: Entering directory `/usr/src/node_modules/pg/build'
[1/2] cxx: src/binding.cc -> build/Release/src/binding_1.o
[2/2] cxx_link: build/Release/src/binding_1.o -> build/Release/binding.node
Waf: Leaving directory `/usr/src/node_modules/pg/build'
'build' finished successfully (0.745s)
[email protected] ./node_modules/pg
+-- [email protected]
더 많은 정보 : 티켓의 주석에서
은, 해당 설치는 다음과 같이 갔다 :[[email protected] ~]# ls -la /usr/src/node_modules/pg
total 68
drwxr-xr-x 9 root root 4096 Apr 26 22:34 .
drwxr-xr-x 3 root root 4096 Apr 26 22:34 ..
drwxr-xr-x 2 root root 4096 Apr 26 22:34 benchmark
drwxr-xr-x 4 root root 4096 Apr 26 22:34 build
drwxr-xr-x 3 root root 4096 Apr 26 22:34 lib
-rw-r--r-- 1 root root 5618 Apr 26 22:34 .lock-wscript
-rw-r--r-- 1 root root 1269 Feb 23 23:58 Makefile
drwxr-xr-x 3 root root 4096 Apr 26 22:34 node_modules
-rw-r--r-- 1 root root 21 Mar 3 15:19 .npmignore
-rw-r--r-- 1 root root 962 Apr 26 22:34 package.json
-rw-r--r-- 1 root root 6843 Mar 27 09:30 README.md
drwxr-xr-x 2 root root 4096 Apr 26 22:34 script
drwxr-xr-x 2 root root 4096 Mar 21 23:37 src
drwxr-xr-x 5 root root 4096 Apr 26 22:34 test
-rw-r--r-- 1 root root 990 Feb 23 23:58 wscript
[[email protected] ~]#
약간에 "Hello World"는 (만세!) 예를 잘 작동 Node.js를하지만, 간단한 포스트 그레스의 예는 모듈을 찾을 수 없다는의 require('pg')
문에 실패합니다. 서버를 살펴본 결과 pg.js
파일을 찾을 수 없습니다.
node-postgres 빌드가 실패한 이유에 대한 단서가 있습니까?
pg npm을 설치할 경로와 작업중인 경로에 대한 세부 정보를 제공하십시오. 또한 app.js의 경로는 무엇입니까? – k00k
@ k00k, pg npm이/usr/src/node_modules/pg에 설치되어있는 것처럼 보입니다. 그러나 서버에서 아무 pg.js도 찾을 수 없습니다. 내 응용 프로그램의 파일은/home/barton/nodetest입니다. –
'ls -la/usr/src/node_modules/pg'를 입력하면 무엇이 보입니까 – k00k