Skip to content

Instantly share code, notes, and snippets.

@AilisObrian
Last active January 23, 2017 10:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AilisObrian/76d05589b9b2fcefe57bed8d69769e13 to your computer and use it in GitHub Desktop.
Save AilisObrian/76d05589b9b2fcefe57bed8d69769e13 to your computer and use it in GitHub Desktop.
Node.JS 개발 환경 구성!

최신 Node.js 설치 및 사용

  • $로 시작하는 줄은, 한줄 한줄 복사해서 터미널에서 실행해주셔야합니다.
  • 터미널을 재시작 하여야 할 수도 있습니다.
    • 재시작 후, 현재 작업하는 폴더로 다시 이동해주셔야합니다.

1. anyenv 설치

$ git clone https://github.com/riywo/anyenv ~/.anyenv
$ echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(anyenv init -)"' >> ~/.bash_profile

(주의) 터미널에서 위의 명령을 실행 후, 터미널을 끄고 다시 킵니다.

2. ndenv 설치

$ anyenv install ndenv

(주의) 터미널에서 위의 명령을 실행 후, 터미널을 끄고 다시 킵니다.

3. node 설치

$ ndenv install v6.9.1

(주의) 터미널에서 위의 명령을 실행 후, 터미널을 끄고 다시 킵니다.

4. 현재 폴더에서 설치 확인

  • $ cat .node-version
    • v6.9.1
      • 우리는 이 폴더에서는 Node v6.9.1을 사용하기로 하였습니다.
  • $ node --version
    • v6.9.1
      • 여기에 저희가 설치한 Node의 버전이 나와야합니다.
  • $ npm | tail -1
    • npm@3.8.6 /Users/humanscape/.anyenv/envs/ndenv/versions/v6.9.1/lib/node_modules/npm
      • 여기에 저희가 설치한 node의 버전이 경로의 중앙에 나와야합니다.

(알림) 다른 폴더에서도 특정 노드의 버전을 사용하고 싶을 경우, $ ndenv local v6.9.1 를 사용해야 합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment