글

라벨이 nodejs인 게시물 표시

Install node and yarn on Linux

Install nodejs v8.x curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs sudo apt-get install -y build-essential node --version Install yarn curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update && sudo apt-get install yarn yarn --version Update yarn sudo apt-get update && sudo apt-get install yarn

Node.js Express-generator 로 생성한 Web App PM2로 실행하기

Express로 간단하게 작성한 Web application를 PM2로 시작하는 방법은 아래와 같다. > pm2 start  app.js  // Not working 하지만 Express-generator를 이용해 작성한 Web app의 경우 위와 같이 하면 process는 생성되지만 제대로 port를 listen 하지 못했다. 에러 메시지도 없어 헤매다가 구글링 끝에 찾았다. 아래와 같이 하면 된다. > pm2 start ./bin/www  Web application written using express-generator can be started by PM2 as above. 이미 package.json 파일에 실행 방법이 있었는데 서두르다 놓쳤다. {   ...   "scripts": {     "start": "node ./bin/www"   ... },