Macで$pipenv installをした時にjson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)が出たら

# エラーが出たぞ!

こんな感じのエラーが出たら

```terminal
$ pipenv install
Pipfile.lock is corrupted, replaced with ()…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 254, in install
    editable_packages=state.installstate.editables,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1874, in do_install
    keep_outdated=keep_outdated
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1221, in do_init
    pypi_mirror=pypi_mirror,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1055, in do_lock
    packages, project, r=False, include_index=True
  File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 828, in convert_deps_to_pip
    indexes = project.sources if hasattr(project, "sources") else []
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 862, in sources
    if self.lockfile_exists and hasattr(self.lockfile_content, "keys"):
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 615, in lockfile_content
    return self.load_lockfile()
  File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 999, in load_lockfile
    j = json.load(lock)
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```

一番したのトレースバックだけをみてたら解決策が出てこなくて一番上を見たらPipfile.lockがコンフリクトしてるよ！って出てました。

これの解決方法はPipfile.lockを削除し、新たに

```
$ pipenv install
```

で良いです。

なお、PipenvはPipfile にインストールしたいバージョンを書くことで、Pipfile.lock に実際にインストールしたバージョンが記録されるというものです。こうして開発者がインストールしたのと同じ環境を他の人も再現出来るので複数人での開発に便利です。

なお、これだけだと別にそんなに気にする必要もないのですが、意外とこのエラーは実際の開発でも起こる現象らしく、gitで複数のブランチを切ってそれがmasterブランチにマージされたものを手元にpullするとコンフリクトが発生するようです。
その際は手元のPipfile.lockを削除し、再び

```
$ pipenv install
$ git add Pipfile.lock
```

でオーケーです。