LoginSignup
1
1

More than 3 years have passed since last update.

Herokuを実行した時のエラー

Last updated at Posted at 2020-12-08

エラー状況

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