0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CircleCIでyarnが通らなくなって詰んだのでPATHを通して解決する

Last updated at Posted at 2018-03-20

事象

突然CircleCI上でテストがコケるようになりました。

調べてみるとwebpackerがフックしているassets:precompileで失敗している様子。。

# !/bin/bash -eo pipefail
bundle exec rake assets:precompile
/home/circleci/my_project/vendor/bundle/ruby/2.5.0/bin/rake: No such file or directory - yarn
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
Exited with code 1
  1. assets:precompileをフックしてwebpacker:compileが実行される
  2. webpacker:compile内でyarnが実行される
  3. yarnないよ!って怒られる

今まで何も言わないいい子だったのにどうして突然・・・ :sob:

原因

CircleCIコミュニティにも報告が上がってました。
Yarn missing from latest node 8 images? - Bug Reports - CircleCI Community Discussion

yarnのパスが通ってないバグがあったようです。(すでにmerge済)
Fixed symbolic links to yarn and yarnpkg by cecton · Pull Request #650 · nodejs/docker-node

解決

とりあえずyarnが実行できるようにPATHを追加してあげればOK。

PATH: "/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

もしくは

- run: PATH=$PATH:/opt/yarn/yarn-v1.5.1/bin

これ、CircleCIのキャッシュの運次第らしい :fearful:
(dockerイメージは circleci/ruby:2.5.0-node-browsers を使ってました)

最近のNode.js公式Dockerイメージでyarnのパスが通ってないバグ。最新では直ってるけどCircleCIのキャッシュガチャで当たると落ちる
http://b.hatena.ne.jp/entry/360606178/comment/teppeis

てんやわんやでしたー。

以上。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?