각종 시스템 설치 Node. js

7792 단어 UI
링크
 
NodeJS 버 전 문 제 를 꼭 주의 하 세 요. 높 을 수록 좋 은 것 이 아 닙 니 다. 현재 환경 cygwin 등 설정 과 조 화 를 이 루어 야 합 니 다. 그렇지 않 으 면 상당히 번 거 로 운 일 을 만 날 수 있 습 니 다!!
Mac
Mac 에서 homebrew 사용 하 는 것 을 좋아한다 면 한 줄 로 만 담 을 수 있 습 니 다.
brew install node

그렇지 않 으 면 수 동 으로 설치 하 는 것 만 고려 할 수 있 습 니 다. 절 차 는 다음 과 같 습 니 다.
  • Xcode 설치
  • git 설치
  • 아래 명령 행 을 실행 하여 node. js
    git clone git://github.com/joyent/node.git cd node ./configure make sudo make install
  • 를 컴 파일 합 니 다.

    Ubuntu
  • 설치 의존 팩
    sudo apt-get install g++ curl libssl-dev apache2-utils sudo apt-get install git-core
  • 아래 명령 행 실행:
    git clone git://github.com/joyent/node.git cd node ./configure make sudo make install

  • Windows
    cygwin 으로 node 를 설치 합 니 다. 절 차 는 다음 과 같 습 니 다.
  • 설치 cygwin
  • cygwin 디 렉 터 리 에서 setup. exe 를 실행 하여 아래 목록 에 있 는 가방 을 설치 합 니 다.
  • devel → openssl
  • devel → g++-gcc
  • devel → make
  • python → python
  • devel → git

  • cygwin 실행
  • 아래 명령 행 실행:
    git clone git://github.com/joyent/node.git cd node ./configure make sudo make install

  • Centos
    yum install gcc-c++ openssl-devel wget --no-check-certificate https://github.com/joyent/node/tarball/v0.3.3 tar -xzvf ry-node-v0.3.3-0-g57544ba.tar.gz cd ry-node-v0.3.3-0-g57544bac1 ./configure make make install

    Hello Node.js!
    hello 와 같은 작은 프로그램 을 작성 합 니 다.node. js 설치 가 올 바른 지 확인 하기:
    var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Node.jsn'); }).listen(8124, "127.0.0.1"); console.log('Server running at http://127.0.0.1:8124/');

    이 코드 를 node 로 실행 합 니 다.
    node hello_node.js Server running at http://127.0.0.1:8124/

    현재 브 라 우 저 로 열기http://127.0.0.1:8124/ 좋 은 소식 을 볼 수 있 을 거 예요.

    좋은 웹페이지 즐겨찾기