端口无法连接,服务器,本地主机

qeeaahzv  于 2021-06-09  发布在  Redis
关注(0)|答案(0)|浏览(292)

所以我有一个程序在我的电脑上运行服务器localhost:1234 and 当运行我的程序时,服务器退出连接到1234端口,但继续监听3000端口。相关控制台日志:

xmickellx@DESKTOP-JJ707K1:/mnt/c/users/mickell/desktop/Cypher-Network$ npm run dev

> cypher-network@0.0.0 dev /mnt/c/users/mickell/desktop/Cypher-Network
> npm run dev-client & npm run start-redis && cross-env ENV='development' nodemon index.js

> cypher-network@0.0.0 start-redis /mnt/c/users/mickell/desktop/Cypher-Network
> redis-server --daemonize yes

> cypher-network@0.0.0 dev-client /mnt/c/users/mickell/desktop/Cypher-Network
> npm run clean && parcel client/src/index.html --out-dir client/dist

7672:C 01 Mar 23:29:56.314 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
7672:C 01 Mar 23:29:56.315 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=7672, just started
7672:C 01 Mar 23:29:56.315 # Configuration loaded

> cypher-network@0.0.0 clean /mnt/c/users/mickell/desktop/Cypher-Network
> rm -rf .cache client/dist

[nodemon] 1.18.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node index.js`
Server running at http://localhost:1234
⠴ Building Well.js...listening at localhost:3000
Message received. Channel: BLO

第一次这样连接。。。但后来它崩溃了,只监听端口3000。进入长控制台日志:

⠸ Building _classof.js...[nodemon] restarting due to changes...
⠼ Packaging...[nodemon] starting `node index.js`
⠦ Building hmr-runtime.js...[nodemon] restarting due to changes...
[nodemon] starting `node index.js`
✨  Built in 16.78s.
listening at localhost:3000

我做了一个基本的telnet命令来检查端口是否被其他东西占用,然后这个弹出。。。

C:\Users\Mickell>telnet mickell 1234
'telnet' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Mickell>telnet mickell 1234
Connecting To mickell...Could not open connection to the host, on port 1234: Connect failed

当服务器端开发时,我非常不知道,如果有人能帮助太好了!
编辑:
运行redis cli命令时,这是redis连接到的地方。。127.0.0.1:6379>也许这就是问题所在?
编辑:

npm run start

> cypher-network@0.0.0 start /mnt/c/users/mickell/desktop/Cypher-Network
> npm run build-client && node index.js

> cypher-network@0.0.0 build-client /mnt/c/users/mickell/desktop/Cypher-Network
> npm run clean && parcel build client/src/index.html --out-dir client/dist

> cypher-network@0.0.0 clean /mnt/c/users/mickell/desktop/Cypher-Network
> rm -rf .cache client/dist

✨  Built in 32.79s.

client/dist/src.a1dc3d06.js.map     ⚠️  1.19 MB     429ms
client/dist/src.a1dc3d06.js          512.27 KB    25.56s
client/dist/logo.04580eb6.png         50.84 KB    14.24s
client/dist/src.e852c4ed.css.map         957 B       5ms
client/dist/index.html                   454 B     6.61s
client/dist/src.e852c4ed.css             454 B    17.15s
listening at localhost:3000
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: Redis connection to ec2-34-225-229-4.compute-1.amazonaws.com:19289 failed - connect ECONNREFUSED 34.225.229.4:19289
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
Emitted 'error' event at:
    at RedisClient.on_error (/mnt/c/users/mickell/desktop/Cypher-Network/node_modules/redis/index.js:406:14)
    at Socket.<anonymous> (/mnt/c/users/mickell/desktop/Cypher-Network/node_modules/redis/index.js:279:14)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypher-network@0.0.0 start: `npm run build-client && node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cypher-network@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/xmickellx/.npm/_logs/2020-03-03T05_10_16_605Z-debug.log
xmickellx@DESKTOP-JJ707K1:/mnt/c/users/mickell/desktop/Cypher-Network$

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题