2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

React NativeでCommand /bin/sh failed with exit code 2のビルドエラー

Posted at

以下のようなビルドエラーが発生しました。

Connection to localhost port 8081 [tcp/sunproxyadmin] succeeded!
Port 8081 already in use, packager is either not running or not running correctly
Command /bin/sh failed with exit code 2

すでに8081ポートのnodeのプロセスが使われているとのことです。

プロセスを確認するコマンドをうちます

ターミナル
lsof -n -i4TCP:8081

以下のような結果がでます。

ターミナル
COMMAND   PID      USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    14733 nishiyama   18u  IPv6 0x2eb9a9c7e8b5881f      0t0  TCP *:sunproxyadmin (LISTEN)

PIDの列のプロセスIDを使って、Killします。
<PID>は上記の例だと、14733になります。

ターミナル
kill -9 <PID>

これで再度ビルドしてみてください。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?