[nodejs] exprss web framework 설치 및 사용법
오늘은 nodejs의 express라는 web framework에 대해 알아보도록 하겠습니다.
설치환경
OS ubuntu 12.10
nodejs v0.8.15
npm 1.1.66
step 1. express 설치
$ npm install express -g
※주의사항
express가 동작을 안하는 경우가 생겨 확인해 보았더니 nodejs 버전이 0.6때 로 설치가 되어 재설치 하였습니다.
참고하시기 바랍니다.
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
또한 중간중간 이러한 오류도 발견되는 경우가 있습니다.
이럴경우에도 아래와 같이 처리해 주시기 바랍니다.
.
.
.
npm http 200 https://registry.npmjs.org/cookie/-/cookie-0.0.5.tgz
npm http 200 https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.1.1.tgz
npm http 200 https://registry.npmjs.org/methods/-/methods-0.0.1.tgz
npm WARN package.json methods@0.0.1 No README.md file found!
npm http 200 https://registry.npmjs.org/cookie-signature/-/cookie-signature-0.0.1.tgz
npm http 200 https://registry.npmjs.org/send/-/send-0.1.0.tgz
npm http 200 https://registry.npmjs.org/debug/-/debug-0.7.0.tgz
npm http 200 https://registry.npmjs.org/connect/2.7.1
npm http GET https://registry.npmjs.org/connect/-/connect-2.7.1.tgz
step 2. express web project 생성
$ cd ~/work
[ 그림1 ] 결과화면