2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Makefile:2: *** missing separator. Stop.エラーでMakefileが実行できない

Last updated at Posted at 2024-09-07

はじめに

makefileを実行する際にエラーが出たので、解決方法をまとめます。

事象

以下のMakefileを実行しようとした際にエラーが発生

Makefile
deploy:
  npm run build
  firebase deploy
$ make deploy

Makefile:2: *** missing separator.  Stop.

原因

コピペで持ってきたときに、先頭の行にスペースが入っていた

makefileはタブでインデントされている必要がある

解決方法

先頭行をタブでインデントする

これでもうまくいかない場合はvscodeの設定で空白がスペースになっている可能性がある
image.png

スペースをクリックして、タブのインデントに変更
image.png

2を選択(選択する数字は任意)
image.png

終わりに

タブとスペースを分けて認識するものはよくあるので、注意したい。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?