const portfinder = require('portfinder');
const port = await portfinder.getPortPromise();
两行代码
端口搜索范围
默认情况下,portfinder将开始搜索8000并扫描,直到达到最大端口号(65535)
源码的路径是在node_modules/@vue/cli-service/lib/commands/serve.js
默认情况下,portfinder将开始搜索8000并扫描,直到达到最大端口号(65535)
源码的路径是在node_modules/@vue/cli-service/lib/commands/serve.js
相关文章: