質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

React.js

Reactは、アプリケーションのインターフェースを構築するためのオープンソースJavaScriptライブラリです。

Q&A

解決済

1回答

1392閲覧

railsとreactでアプリ作成をしたいのですが、rails newでエラーが出る

kokosi1062

総合スコア39

Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

React.js

Reactは、アプリケーションのインターフェースを構築するためのオープンソースJavaScriptライブラリです。

0グッド

0クリップ

投稿2020/11/11 02:17

railsでreact使ったview周りの実装をしてみたいと思い、アプリ作成を進めています。
sshで接続しており、ubuntu実装済みです。
rails newコマンドを実行したところ、下記部分にエラーが出たのですが、
これは問題ないのでしょうか?

rails 6.0.3
ruby 2.5.1
yarn 1.22.5
node 9.11.2
ubuntu 16.04.7

railsnew

1Bundle complete! 17 Gemfile dependencies, 74 gems now installed. 2Use `bundle info [gemname]` to see where a bundled gem is installed. 3 run bundle binstubs bundler 4The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. 5 run bundle exec spring binstub --all 6* bin/rake: Spring inserted 7* bin/rails: Spring inserted 8 rails webpacker:install 9 create config/webpacker.yml 10Copying webpack core config 11 create config/webpack 12 create config/webpack/development.js 13 create config/webpack/environment.js 14 create config/webpack/production.js 15 create config/webpack/test.js 16Copying postcss.config.js to app root directory 17 create postcss.config.js 18Copying babel.config.js to app root directory 19 create babel.config.js 20Copying .browserslistrc to app root directory 21 create .browserslistrc 22The JavaScript app source directory already exists 23 apply /home/xxxxxxxxxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/webpacker-4.3.0/lib/install/binstubs.rb 24 Copying binstubs 25 exist bin 26 create bin/webpack 27 create bin/webpack-dev-server 28 append .gitignore 29Installing all JavaScript dependencies [4.3.0] 30 run yarn add @rails/webpacker@4.3.0 from "." 31yarn add v1.22.5 32info No lockfile found. 33[1/4] Resolving packages... 34warning @rails/webpacker > node-sass > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 35warning @rails/webpacker > node-sass > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 36warning @rails/webpacker > node-sass > request > har-validator@5.1.5: this library is no longer supported 37warning @rails/webpacker > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. 38warning @rails/webpacker > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. 39warning @rails/webpacker > webpack > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated 40warning @rails/webpacker > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated 41[2/4] Fetching packages... 42error compression-webpack-plugin@4.0.1: The engine "node" is incompatible with this module. Expected version ">= 10.13.0". Got "9.11.2" 43error Found incompatible module. 44info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. 45Installing dev server for live reloading 46 run yarn add --dev webpack-dev-server from "." 47yarn add v1.22.5 48info No lockfile found. 49[1/4] Resolving packages... 50warning webpack-dev-server > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. 51warning webpack-dev-server > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. 52warning webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated 53warning webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated 54[2/4] Fetching packages... 55info fsevents@1.2.13: The platform "linux" is incompatible with this module. 56info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. 57error get-caller-file@2.0.5: The engine "node" is incompatible with this module. Expected version "6.* || 8.* || >= 10.*". Got "9.11.2" 58error Found incompatible module. 59info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. 60Webpacker successfully installed ???? ????

アプリは作成できていて、このまま下記サイトを参照に
実装しているのですが、
webページで下記エラーが出ます。
調べてみて原因が分からず、もしやrails newのエラーが原因かと思い質問させていただきました。

rails

1Webpacker::Manifest::MissingEntryError in Cat#index 2 <%= javascript_pack_tag 'application' %>

参照サイト

https://www.petitmonte.com/ruby/rails-react-project.html

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

error compression-webpack-plugin@4.0.1: The engine "node" is incompatible with this module. Expected version ">= 10.13.0". Got "9.11.2"

エラーメッセージのとおりです。Node.jsのバージョンが古くて対応していないライブラリが出ています。

投稿2020/11/11 02:21

maisumakun

総合スコア145184

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

maisumakun

2020/11/11 02:22

なお、Node.jsの奇数バージョン(9.*.*など)は開発版という位置づけですので、Node.jsを使うだけであれば偶数バージョン(10.*.*や12.*.*など)にすることをおすすめします。
kokosi1062

2020/11/11 05:28 編集

ありがとうございます。 node 10.13.0にバージョンアップして rails newを実行したところ、eroorがなくなりました。 ただ、所々にwarningが表示されているのですが、 こちらは気にしなくて大丈夫でしょうか? 調べてみると、警告のように感じましたが、、、 warning @rails/webpacker > node-sass > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning @rails/webpacker > node-sass > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning @rails/webpacker > node-sass > request > har-validator@5.1.5: this library is no longer supported warning @rails/webpacker > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. warning @rails/webpacker > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. warning @rails/webpacker > webpack > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated warning @rails/webpacker > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0". warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
maisumakun

2020/11/11 05:45

そうですね、内部で使っているライブラリが古いと言うだけですので、とりあえずはそのままで動きます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問