naichi's lab

3日後の自分(他人)への書き置き

Railsアプリのherokuデプロイが突然失敗するようになった(error upath@1.0.2: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.14.1")

Herokuへのデプロイでエラー

タイトルの通り、突然Railsアプリのデプロイが失敗するようになりました。

デプロイログのエラーを一部抜粋

-----> Installing node-v10.14.1-linux-x64
-----> Installing yarn-v1.12.3
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       #<Redis client v4.0.1 for redis://ec2-35-173-102-234.compute-1.amazonaws.com:7079/0>
       yarn install v1.12.3
       warning package.json: No license field
       warning No license field
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       info fsevents@1.1.3: The platform "linux" is incompatible with this module.
       info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
       error upath@1.0.2: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.14.1"
       error Found incompatible module
       info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
       Webpacker is installed 🎉 🍰
       Using /tmp/build_2071e8e9a80e6eaf98a1a7d975ef8577/config/webpacker.yml file for setting up webpack paths
       Compiling…
       Compilation failed:
       bundler: failed to load command: webpack (/tmp/build_2071e8e9a80e6eaf98a1a7d975ef8577/vendor/bundle/ruby/2.4.0/bin/webpack)

ソースは何も変えてないのでHeroku側の環境が変わった予感。

対応

ググったら出てきた

qiita.com

> yarn upgrade

yarn.lock ファイルがめっちゃ更新された。

デプロイ成功〜。