Rails5 yarn addでEIO: i/o errorになる場合の対応


発生したエラー

パッケージ追加しようとしたら。。。

# yarn add jquery-file-upload
yarn add v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "EIO: i/o error, scandir '/sakura/node_modules/request/lib'".
info If you think this is a bug, please open a bug report with the information provided in "/sakura/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

error An unexpected error occurred: "EIO: i/o error, scandirってなんですかね。投げやりすぎやしませんかね。どうすればいいんですかね。

解決方法

yarnを実行するだけだった。
参考:https://github.com/yarnpkg/yarn/issues/4455

# yarn
yarn install v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 159.12s.

改めてパッケージ追加

できた!

# yarn add jquery-file-upload
yarn add v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 4 new dependencies.
info Direct dependencies
└─ [email protected]
info All dependencies
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 174.41s.