エラー状況
Node.js(Express)をHeroku実行を試みる。
細かな手順は割愛、Herokuにpushする。
$ git push heroku master
ビルドエラー
remote: ERROR in [copy-webpack-plugin] unable to locate '~~~/static' at '~~~/static'
remote:
remote: Build failed with errors.
環境
| version | |
|---|---|
| Node.js | v11.15.0 |
| Heroku | heroku-20 |
原因
プロジェクト直下にあるstaticがない。
このstaticディレクトリ、ローカルでは__見かけ__は空のディレクトリ。「いつの間にこんなディレクトリ作ったっけ?」なノリで、削除していた。またstaticディレクトリには隠しファイル.gitkeepがあり、消してはいけない(戒め)
対処
staticと.gitkeepを用意してあげる。
$ mkdir static
$ touch static/.gitkeep