LoginSignup
31
19

More than 3 years have passed since last update.

yarnが原因でdocker-compose up ができない ( Your Yarn packages are out of date!)

Posted at

docker-compose up すると、下記のエラーが発生。解決していきます。

web_1  | => Booting Puma
web_1  | => Rails 6.0.2.1 application starting in development
web_1  | => Run `rails server --help` for more startup options
warning Integrity check: System parameters don't match
error Integrity check failed
error Found 1 errors.
web_1  |
web_1  |
web_1  | ========================================
web_1  |   Your Yarn packages are out of date!
web_1  |   Please run `yarn install --check-files` to update.
web_1  | ========================================
web_1  |
web_1  |
web_1  | To disable this check, please change `check_yarn_integrity`
web_1  | to `false` in your webpacker config file (config/webpacker.yml).
web_1  |
web_1  |
web_1  | yarn check v1.21.1
web_1  | info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
web_1  |
web_1  |
web_1  | Exiting
myapp_web_1 exited with code 1

原因

ローカルでyarnを最新にしていたから整合性が取れなくなったのかな。と考えています。
yarnのパッケージに古いものが含まれているので、アップグレードしてね!といった様子。
なので、

yarn upgrade

これで直るか!と思いましたが、エラー文は変わらず。

結論 check_yarn_integrity: false に変更する

先程のエラー文をもう一度眺める。

web_1  | To disable this check, please change `check_yarn_integrity`
web_1  | to `false` in your webpacker config file (config/webpacker.yml).

下記の様に変更。

config/webpacker.yml
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
check_yarn_integrity: false

check_yarn_integrity については、
webpacker の check_yarn_integrity オプションについて調べてみた
が参考になります。

再度、 docker-compose up を実行すると、無事起動しました。

31
19
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
31
19