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

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

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

Unicornは、汎用のRackアプリケーションサーバ。RackとWebサーバーの機能を併せ持ちます。レスポンス処理や、Nginx単体がRackの機能をサポートしていない事から、一般的にはNginx+Unicorn+Railsの構成を取って用います。

Yarn

Yarnは、Facebook/Exponent/Google/Tildeが開発したJavaScriptのパッケージマネージャ。npmよりもインストールが速く、厳密にモジュールのバージョンを固定できるなど、npmの問題を解決。npmと互換性があり、同じpackage.jsonを使用できます。

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

解決済

1回答

1218閲覧

Unicornが起動させたいです

0W5E8fPq1EOm4yE

総合スコア13

unicorn

Unicornは、汎用のRackアプリケーションサーバ。RackとWebサーバーの機能を併せ持ちます。レスポンス処理や、Nginx単体がRackの機能をサポートしていない事から、一般的にはNginx+Unicorn+Railsの構成を取って用います。

Yarn

Yarnは、Facebook/Exponent/Google/Tildeが開発したJavaScriptのパッケージマネージャ。npmよりもインストールが速く、厳密にモジュールのバージョンを固定できるなど、npmの問題を解決。npmと互換性があり、同じpackage.jsonを使用できます。

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2021/09/18 08:07

編集2021/09/18 10:51

状況

Unicornを起動した際に画像のようなエラーが出てしまいました。
原因をログで調べたところアセットパイプラインがインストールできておらず「error Command "webpack" not found」と出てしまいました。yarnやwebpackを再インストールしたり、packege.jsonに「"@rails/webpacker": "5.2.1"」と追加したりとしましたが相変わらずの状態です。
何が原因かご教授いただければと思います。

イメージ説明

コード

ターミナル [ec2-user@ip-172-31-33-129 note]$ rails assets:precompile RAILS_ENV=production yarn install v1.22.5 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "linux" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. error webpack-dev-server@4.2.1: The engine "node" is incompatible with this module. Expected version ">= 12.13.0". Got "10.24.1" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Compiling... Compilation failed: yarn run v1.22.5 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command "webpack" not found.
{ "name": "note", "private": true, "dependencies": { "@babel/preset-react": "^7.14.5", "@babel/preset-typescript": "^7.15.0", "@nathanvda/cocoon": "^1.2.14", "@rails/actioncable": "^6.0.0", "@rails/activestorage": "^6.0.0", "@rails/ujs": "^6.0.0", "@rails/webpacker": "5.2.1", "@types/react": "^17.0.18", "@types/react-dom": "^17.0.9", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "bootstrap": "^5.1.0", "cocoon": "github:nathanvda/cocoon#c24ba53", "cocoon-js": "^0.0.5", "jquery": "^3.6.0", "note": "^1.2.1", "popper.js": "^1.16.1", "prop-types": "^15.7.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react_ujs": "^2.6.1", "turbolinks": "^5.2.0", "typescript": "^4.3.5" }, "version": "0.1.0", "devDependencies": { "@webpack-cli/serve": "^1.5.2", "webpack": "^4.46.0", "webpack-cli": "^3.3.12", "webpack-dev-server": "^4.2.1" }, "description": "", "main": "babel.config.js", "directories": { "lib": "lib", "test": "test" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "git+https://github.com/aseat/note.git" }, "keywords": [], "author": "", "license": "ISC", "bugs": { "url": "https://github.com/aseat/note/issues" }, "homepage": "https://github.com/aseat/note#readme" }

試したこと

・package.jsonに「"@rails/webpacker": "5.2.1" 」と追記
・下記サイトを参考に実施
https://github.com/rails/webpacker/issues/522
https://qiita.com/ryokkkke/items/5cfbf91fc3e3a3831da6

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

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

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

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

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

guest

回答1

0

自己解決

[ec2-user@ip-172-31-33-129 note]$ npm uninstall webpackと打ったら直りました

投稿2021/09/18 11:25

0W5E8fPq1EOm4yE

総合スコア13

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問