エラー内容
ビルドの段階でエラーがいくつか発生しました。
1つ目
tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
package-lock.jsonを削除したら、このエラーは表示されなくなりました。
2,3つ目
warning " > @testing-library/user-event@12.8.3" has unmet peer dependency "@testing-library/dom@>=7.21.4".
warning "recharts > react-smooth@2.0.0" has unmet peer dependency "prop-types@^15.6.0".
https://qiita.com/hayato94087/items/82c36b4063ef935515fa
こちらの記事にこのエラーの解消方法が載っていました。
4つ目
2021-07-21T07:11:33.617Z [INFO]: ./src/App.tsx
Cannot find file './components/currentWeather/CurrentWeather' in './src'.
2021-07-21T07:11:33.634Z [WARNING]: error Command failed with exit code 1.
githubのリモートリポジトリを見たらCurrentweather.tsx
と、w
が小文字になっていました。
それがローカルのファイルと整合性が取れなくて、エラーになっていたみたいです。
変更方法
githubのCurrentWeather.tsx
のファイルを開くと、そのファイルを編集できます。
そこで、Currentweather.tsx
をCurrentWeather.tsx
に書き換え、保存しました。
その後、一度ローカルでgit pull
をして、readme
などを少し変更して、再度push
し、amplify
を再デプロイしたところ、無事にデプロイが完了しました。
まとめ
以上が今回のエラーとその改善方法になります。