Help us understand the problem. What is going on with this article?

ConohaにReact環境を構築

More than 1 year has passed since last update.

概要

・ConohaのVPS
・CentOS7.4で構築

手順

apacheインストール

yum -y install httpd
※7系ではデフォルトでfirewallが有効になっているため
firewall-cmd --add-service=http --zone=public --permanent
firewall-cmd --add-service=https --zone=public --permanent
systemctl restart firewalld
systemctl enable httpd
※適当に/var/www/html/index.htmlを作って、外からアクセスできることを確認

npmインストール

yum install yum-priorities
yum install epel-release.noarch
vim /etc/yum.repos.d/epel.repo
※yum updateしたときに消えないように
[epel]enabled=0に変更
yum install nodejs npm --enablerepo=epel

Reactプロジェクト作成

適当なワークディレクトリ移動
これを参考に「./node_modules/.bin/webpack」まで実行
https://qiita.com/akirakudo/items/77c3cd49e2bf39da79dd

エラー1:"Webpack has been initialised using a configuration object that does not match the API schema.~"
development.jsを修正
resolve: {
extensions: ['*', '.js']
},

エラー2:"Can't resolve 'babel'"
npm i -D babelを実行

エラー3:"The node API for babel has been moved to babel-core."
ここを参考に修正
https://github.com/babel/babel-loader/blob/master/README.md#the-node-api-for-babel-has-been-moved-to-babel-core

成功!
「./node_modules/.bin/webpack --display-error-details」でオプションをつけるとエラーの詳細が分かる。

あとは先ほどの参考ページでwebpack-dev-serverが起動できればひとまずOK

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
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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