React의 샘플 코드 시작하기

4189 단어 React
읽고 있습니다시작 React.
샘플 코드를 이동하면서 읽습니다. 샘플 코드의 설치가 잘 어울리기 때문에 공유합니다.
요점은 ndenv로 버젼을 지정하는 것입니다.
기본적으로 부록 AP228 단계에 따릅니다.

  • 일본 사이트부터 일본어 버전 샘플 코드까지.
  • 압축 해제
  •   unzip survey_builder.zip
    
  • 카탈로그 이동
  •   cd survey_builder_150312
    
  • node의 version을 지정합니다.(ndenv 이용)
  •   $ ndenv local v0.10.41
      $ node -v
      v0.10.41
    
  • npm 이용 최신
  •   $ npm -v
      3.5.3
    
  • install
  •   $ npm install
      npm install
      npm WARN deprecated [email protected]: This package is no longer   maintained. See its readme for upgrade details.
      npm WARN deprecated [email protected]: react-tools is deprecated. For more information, visit https://fb.me/react-tools-deprecated
      npm WARN deprecated [email protected]: Renamed karma-browserify as of 1.0
      npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
      npm WARN deprecated [email protected]: the module is now available as 'css-select'
      npm WARN deprecated [email protected]: the module is now available as 'css-what'
    
      > [email protected] install /Users/snumano/Documents/Javascript/React/survey_builder_150312/node_modules/fsevents
      > node-pre-gyp install --fallback-to-build
    
      [fsevents] Success: "/Users/snumano/Documents/Javascript/React/survey_builder_150312/node_modules/fsevents/lib/binding/Release/node-v11-darwin-x64/fse.node" is installed via remote
    
      > [email protected] install /Users/snumano/Documents/Javascript/React/survey_builder_150312/node_modules/watchify/node_modules/fsevents
      > node-gyp rebuild
    
      CXX(target) Release/obj.target/fse/fsevents.o
      SOLINK_MODULE(target) Release/fse.node
    
      > [email protected] install /Users/snumano/Documents/Javascript/React/survey_builder_150312/node_modules/phantomjs
      > node install.js
    
      PhantomJS not found on PATH
      Download already available at /var/folders/vk/wgk8gyf52tl1ly68pnp0md3m0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip
      Verified checksum of previously downloaded file
      Extracting zip contents
      Removing /Users/snumano/Documents/Javascript/React/survey_builder_150312/node_modules/phantomjs/lib/phantom
      Copying extracted folder /var/folders/vk/wgk8gyf52tl1ly68pnp0md3m0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip-extract-1452994290803/phantomjs-1.9.8-macosx -> /Users/snumano/Documents/Javascript/React/survey_builder_150312/node_modules/phantomjs/lib/phantom
      Writing location.js file
    Done. Phantomjs binary available at /Users/snumano/Documents/Javascript/React/survey_builder_150312/node_modules/phantomjs/lib/phantom/bin/phantomjs
      ---snip---
      npm WARN [email protected] license should be a valid SPDX license expression
    
  • build
  •   $ npm run build
      > [email protected] build /Users/snumano/Documents/Javascript/React/survey_builder_150312
      > browserify -t reactify client/client.js > public/build/bundle.js --debug
    
  • start
  •   $ npm start
      > [email protected] prestart /Users/snumano/Documents/Javascript/React/survey_builder_150312
      > npm run-script build
    
      > [email protected] build /Users/snumano/Documents/Javascript/React/survey_builder_150312
      > browserify -t reactify client/client.js > public/build/bundle.js --debug
    
      > [email protected] start /Users/snumano/Documents/Javascript/React/survey_builder_150312
      > node server/server.js
    
      App started goto - http://0.0.0.0:8080
    
  • 브라우저에서 확인합니다.npm install에는 다양한 정보가 나왔지만, 우선 일하는 것 같아서 OK.
  • 좋은 웹페이지 즐겨찾기