$
로 시작하는 줄은, 한줄 한줄 복사해서 터미널에서 실행해주셔야합니다.- 터미널을 재시작 하여야 할 수도 있습니다.
- 재시작 후, 현재 작업하는 폴더로 다시 이동해주셔야합니다.
-
-
Save minhoryang/41832b2a613ab95df0a96aff7a67e34f to your computer and use it in GitHub Desktop.
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
$ cat .node-version
v6.2.0
- 우리는 이 폴더에서는 Node v6.2.0을 사용하기로 하였습니다.
$ node --version
v6.2.0
- 여기에 저희가 설치한 Node의 버전이 나와야합니다.
$ npm | tail -1
npm@3.8.6 /Users/_/.anyenv/envs/ndenv/versions/v6.2.0/lib/node_modules/npm
- 여기에 저희가 설치한 node의 버전이 경로의 중앙에 나와야합니다.
이 프로젝트에서 사용하는 환경변수는 .env파일에 보관되어 있습니다. autoenv는 이를 자동으로 불러와 줍니다.
$ git clone git://github.com/kennethreitz/autoenv.git ~/.autoenv
$ echo 'source ~/.autoenv/activate.sh' >> ~/.bash_profile
(brew로도 설치할 수 있습니다.)
autoenv:
autoenv: WARNING:
autoenv: This is the first time you are about to source /Users/_/projects/node_workspace/bc1/.env:
autoenv:
autoenv: --- (begin contents) ---------------------------------------
autoenv: if [[ ! -d $PROJECT_PATH_BC1 ]]; then$
autoenv: export PROJECT_PATH_BC1="`pwd`"$
autoenv: export NODE_PATH="$PROJECT_PATH_BC1/node_modules"$
autoenv: export PATH="$NODE_PATH/.bin:$PATH"$
autoenv: fi$
autoenv:
autoenv: --- (end contents) -----------------------------------------
autoenv:
autoenv: Are you sure you want to allow this? (y/N)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment