composer-rest-server Unhandled 'error' event

泪湿孤枕 提交于 2019-12-13 02:16:23

问题


When I try composer-rest-server -c acme-admin@test-bna I get this output:

Discovering the Returning Transactions..
Discovered types from business network definition
Generating schemas for all types in business network definition ...
Generated schemas for all types in business network definition
Adding schemas for all types to Loopback ...
Added schemas for all types to Loopback
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::3000
    at Server.setupListenHandle [as _listen2] (net.js:1360:14)
    at listenInCluster (net.js:1401:12)
    at Server.listen (net.js:1485:7)
    at module.exports.promise.then.then (/usr/local/lib/node_modules/composer-rest-server/cli.js:143:19)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

I am actually doing a udemy course about how to setup a hyperledger multi org network.


回答1:


The error is showing that the port 3000 is busy.

EADDRINUSE means some process is already running on that port.

You can find the process by using the following command:

sudo ss -lptn 'sport = :3000'

It will return you process id, then you can kill it by:

sudo kill -9 process_id



回答2:


The problem was that some process was running on the port 3000. This command fixed it.

fuser -n tcp -k 3000


来源:https://stackoverflow.com/questions/54647469/composer-rest-server-unhandled-error-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!