reactJS install on ubuntu16.04
reactJS를 설치하려면 node.js와 npm을 설치해야한다.
nodejs를 설치하면 npm도 자동설치된다.
주의 사항 nodejs는 nvm으로 설치해야한다.
# apt-get install wget
# wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
# export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
docker 에선 안되어서 #source ~/.bashrc
# nvm install --lts
출처: postype
# apt-get install -y build-essential
# npm install -g create-react-app
# create-react-app voidreact
# cd voidreact
#npm start
출처: codeburst
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
예전 방법
(nodejs는 nvm으로 설치해야한다는 글을 보고 nodejs설치방법 바꿈)
62 apt-get install wget
63 wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
65 apt-get update
66 apt-get install nodejs
67 apt-get install npm
68 nodejs -v
70 apt-get install -y build-essential
71 npm install -g create-react-app
72 create-react-app voidReact
85 ln -s /usr/bin/nodejs /usr/local/bin/node
86 create-react-app voidReact
88 npm cache clean -f
89 npm install -g n
90 n stable
91 n latest
92 nodejs -v
94 create-react-app voidreact
95 ls
96 cd /voidreact
97 cd voidreact
98 npm start
# create-react-app voidreact
// = > 에러발생
// "/usr/bin/env: node: No such file or directory"
// => 해결방법 => 심볼릭 링크 추가
# ln -s /usr/bin/nodejs /usr/local/bin/node
//출처 : blog
= > 에러발생
// You are running Node 4.2.6.
// Create React App requires Node 8 or higher.
// Please update your version of Node.
=> 해결방법 => 업그레이드
# npm cache clean -f
# npm install -g n
# n stable
# n latest