반응형

node.js - 윈도우 설치하기

 

http://nodejs.org/download 에 가서 Windows Installer (.msi)를 받아서 설치.

 

https://nodejs.org/en/

 

안정버전 V5.0으로 다운받아서 설치.

 

설치 후 node.js 콘솔창에서 입력도 가능하고,  .js 파일 생성 후

도스 창에서 $node 해당파일.js 를 실행 할 수 있다.

 

콘솔창을 종료시키고 싶으면 Ctrl + C 두 번!

 

 

아니면 Express를 사용해서 설치 가능하다.  http://expressjs.com/ 

 

Installing

Assuming you’ve already installed Node.js, create a directory to hold your application, and make that your working directory.

$ mkdir myapp
$ cd myapp

Use the npm init command to create a package.json file for your application. For more information on how package.json works, see Specifics of npm’s package.json handling.

$ npm init

This command will prompt your for a number of things such as the name and version of your application. For now, you can simply hit RETURN to accept the defaults for most of them, except for:

entry point: (index.js)

Enter app.js or whatever you want the name of the main file to be. If you want it to be index.js, hit RETURN to accept the suggested default file name.

Now install Express in the app directory and save it in the dependencies list:

$ npm install express --save

To install Express temporarily, and not add it to the dependencies list, omit the --save option:

$ npm install express

Node modules installed with the --save option are added to the dependencies list in the package.json file. Then usingnpm install in the app directory will automatically install modules in the dependencies list.

 

 

 

 

 

반응형

+ Recent posts