node.js端口号被占用,修改端口号

api-server 文件夹内执行命令行 node app.js,报错 node.js 端口号 8888 被占用。

Error: listen EADDRINUSE :::8888
    at Server.setupListenHandle [as _listen2] (net.js:1286:14)
    at listenInCluster (net.js:1334:12)
    at Server.listen (net.js:1421:7)
    at Function.listen (D:\Web\Task\Task-Vue\5.Truman\api-server\node_modules\ex
press\lib\application.js:618:24)
    at Object. (D:\Web\Task\Task-Vue\5.Truman\api-server\app.js:131:5
)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Emitted 'error' event at:
    at emitErrorNT (net.js:1313:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

解决办法:修改端口号。
打开 config 文件夹,打开 default.json 文件,

"upload_config":{
		"baseURL":"http://127.0.0.1:8888",
		"upload_ueditor":"uploads/ueditor",
		"simple_upload_redirect":"http://127.0.0.1/reload"
	},

“baseURL” 改成 “http://127.0.0.1:8889”

你可能感兴趣的:(node.js端口号被占用,修改端口号)