Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
4
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@snumano

入門Reactのサンプルコード installでハマった

入門Reactを読んでいます。
サンプルコードを動かしながら、読み進めていくのですが、サンプルコードのinstallでハマったので、共有します。
ndenvでversionを指定するのがポイントです。

基本的に、付録A P228の手順に従います。

  1. オライリー・ジャパンのサイトから、日本語版のサンプルコードをdonwload。
  2. 解凍
  unzip survey_builder.zip
  1. ディレクトリ移動
  cd survey_builder_150312
  1. nodeのversionを指定。(ndenv利用)
  $ ndenv local v0.10.41
  $ node -v
  v0.10.41
  1. npmは最新を利用
  $ npm -v
  3.5.3
  1. install
  $ npm install
  npm install
  npm WARN deprecated lodash-node@2.4.1: This package is no longer   maintained. See its readme for upgrade details.
  npm WARN deprecated react-tools@0.11.2: react-tools is deprecated. For more information, visit https://fb.me/react-tools-deprecated
  npm WARN deprecated karma-bro@0.6.2: Renamed karma-browserify as of 1.0
  npm WARN deprecated npmconf@2.1.1: this package has been reintegrated into npm and is now out of date with respect to npm
  npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'
  npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'

  > fsevents@1.0.6 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

  > fsevents@0.2.1 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

  > phantomjs@1.9.19 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 bleeding-edge-sample-app@0.0.1 license should be a valid SPDX license expression
  1. build
  $ npm run build
  > bleeding-edge-sample-app@0.0.1 build /Users/snumano/Documents/Javascript/React/survey_builder_150312
  > browserify -t reactify client/client.js > public/build/bundle.js --debug
  1. start
  $ npm start
  > bleeding-edge-sample-app@0.0.1 prestart /Users/snumano/Documents/Javascript/React/survey_builder_150312
  > npm run-script build

  > bleeding-edge-sample-app@0.0.1 build /Users/snumano/Documents/Javascript/React/survey_builder_150312
  > browserify -t reactify client/client.js > public/build/bundle.js --debug

  > bleeding-edge-sample-app@0.0.1 start /Users/snumano/Documents/Javascript/React/survey_builder_150312
  > node server/server.js

  App started goto - http://0.0.0.0:8080
  1. ブラウザで確認。npm install時にいろいろメッセージが表示されましたが、とりあえず動作しているようなので、これでokとします。

SurveyBuilder.png

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
4
Help us understand the problem. What are the problem?