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

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

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

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

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

AWS(Amazon Web Services)

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

Q&A

解決済

1回答

1959閲覧

AWS デプロイ webpackが見つからない

Meitoku

総合スコア44

Yarn

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

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

AWS(Amazon Web Services)

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

0グッド

0クリップ

投稿2020/11/23 08:59

編集2020/11/27 08:20

AWSデプロイ時に以下のエラーが発生します

Tasks: TOP => deploy:assets:precompile (See full trace by running task with --trace) The deploy has failed with an error: Exception while executing as ec2-user@54.168.63.207: rake exit status: 1 rake stdout: yarn install v1.22.10 [1/4] Resolving packages... [2/4] Fetching packages... info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Compiling... Compilation failed: yarn run v1.22.10 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. warning ../../package.json: No license field warning ../../package.json: No license field error Command "webpack" not found.

webpackはインストールしてますがなぜ起きるのでしょうか?
こちらこちらなど色々試してますがうまくいきません
どのような理由が考えられますでしょうか
ご教授お願いします

node -v v13.2.0 yarn -v 1.22.10

###関連がありそうなファイル

webpack.yml

# Note: You must restart bin/webpack-dev-server for changes to take effect default: &default source_path: app/javascript source_entry_path: packs public_root_path: public public_output_path: packs cache_path: tmp/cache/webpacker webpack_compile_output: true # Additional paths webpack should lookup modules # ['app/assets', 'engine/foo/app/assets'] additional_paths: [] # Reload manifest.json on all requests so we reload latest compiled packs cache_manifest: false # Extract and emit a css file extract_css: false static_assets_extensions: - .jpg - .jpeg - .png - .gif - .tiff - .ico - .svg - .eot - .otf - .ttf - .woff - .woff2 extensions: - .mjs - .js - .sass - .scss - .css - .module.sass - .module.scss - .module.css - .png - .svg - .gif - .jpeg - .jpg development: <<: *default compile: true # Reference: https://webpack.js.org/configuration/dev-server/ dev_server: https: false host: localhost port: 3035 public: localhost:3035 hmr: false # Inline should be set to true if using HMR inline: true overlay: true compress: true disable_host_check: true use_local_ip: false quiet: false pretty: false headers: 'Access-Control-Allow-Origin': '*' watch_options: ignored: '**/node_modules/**' test: <<: *default compile: true # Compile test packs to a separate directory public_output_path: packs-test production: <<: *default # Production depends on precompilation of packs prior to booting for performance. compile: false # Extract and emit a css file extract_css: true # Cache manifest.json for performance cache_manifest: true

Gemfile

source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.5.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.3' # Use mysql as the database for Active Record gem 'mysql2', '0.5.2' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '5.0.7' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use ActiveStorage variant # gem 'mini_magick', '~> 4.8' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'capistrano' gem 'capistrano-rbenv' gem 'capistrano-bundler' gem 'capistrano-rails' gem 'capistrano3-unicorn' end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of chromedriver to run system tests with Chrome gem 'chromedriver-helper' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'pry-rails' gem 'compass-rails', '3.1.0' gem 'sprockets', '3.7.2' gem 'kaminari' gem 'jquery-rails' gem "jquery-ui-rails" gem 'fullcalendar-rails' gem 'momentjs-rails' gem 'rails-i18n' gem 'devise' gem 'carrierwave' gem 'mini_magick' gem "font-awesome-sass" gem 'ancestry' gem 'fog' gem 'webpacker' gem 'bootstrap', '~> 5.0.0.alpha2' group :production do gem 'unicorn', '5.4.1' end

package.json

{ "name": "sample_boad", "private": true, "dependencies": { "@rails/webpacker": "5.2.1", "vue": "^2.6.12", "vue-loader": "^15.9.5", "vue-template-compiler": "^2.6.12", "vuetify": "^2.3.17" }, "devDependencies": { "webpack": "^4.44.2", "webpack-cli": "^3.3.12", "webpack-dev-server": "^3.11.0" }, "babel": { "presets": [ "./node_modules/@rails/webpacker/package/babel/preset.js" ] }, "browserslist": [ "defaults" ], "description": "This README would normally document whatever steps are necessary to get the application up and running.", "version": "1.0.0", "main": "babel.config.js", "directories": { "lib": "lib", "test": "test" }, "scripts": { "start": "webpack-dev-server", "test": "echo \"Error: no test specified\" && exit 1", "build": "webpack --mode development" }, "repository": { "type": "git", "url": "git+https://github.com/katou02/baseball-app.git" }, "keywords": [], "author": "", "license": "ISC", "bugs": { "url": "https://github.com/katou02/baseball-app/issues" }, "homepage": "https://github.com/katou02/baseball-app#readme" }

bin/webpack

Hash: 0b1c0a20c88060441749 Version: webpack 4.44.2 Time: 3361ms Built at: 2020/11/24 0:39:31 Asset Size Chunks Chunk Names js/application-4f62ea677992947f725b.js 4.83 KiB application [emitted] [immutable] application js/application-4f62ea677992947f725b.js.map 4.64 KiB application [emitted] [dev] application js/hello_vue-3eaaef18acbc2a0c9f27.js 3.26 MiB hello_vue [emitted] [immutable] hello_vue js/hello_vue-3eaaef18acbc2a0c9f27.js.map 3.64 MiB hello_vue [emitted] [dev] hello_vue js/top-443a173b319580692cec.js 3.9 KiB top [emitted] [immutable] top js/top-443a173b319580692cec.js.map 3.64 KiB top [emitted] [dev] top manifest.json 972 bytes [emitted] Entrypoint application = js/application-4f62ea677992947f725b.js js/application-4f62ea677992947f725b.js.map Entrypoint hello_vue = js/hello_vue-3eaaef18acbc2a0c9f27.js js/hello_vue-3eaaef18acbc2a0c9f27.js.map Entrypoint top = js/top-443a173b319580692cec.js js/top-443a173b319580692cec.js.map [./app/javascript/app.vue] 339 bytes {hello_vue} [built] [failed] [1 error] [./app/javascript/packs/application.js] 957 bytes {application} [built] [./app/javascript/packs/hello_vue.js] 2.02 KiB {hello_vue} [built] [./app/javascript/packs/top.js] 56 bytes {top} [built] [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 905 bytes {hello_vue} [built] [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 552 bytes {hello_vue} [built] + 9 hidden modules ERROR in ./app/javascript/app.vue 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders > <template> | <v-app id="app"> <!-- 追加 --> | <v-btn>Vuetifyのボタン</v-btn> <!-- 追加 --> @ ./app/javascript/packs/hello_vue.js 10:0-29 17:15-18

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

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

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

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

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

guest

回答1

0

自己解決

node.jsのバージョンを推奨13.7.0以上にすることでエラー解決しました

https://qiita.com/masarufuruya/items/34f7617de45f2d7ca3d3

投稿2020/11/27 08:20

Meitoku

総合スコア44

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問