4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

入門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

4
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?