@lark-project/cli
Version:
飞书项目插件开发工具
17 lines (16 loc) • 737 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNotLoopBackIpv4 = void 0;
const ip_1 = require("ip");
const logger_1 = require("./logger");
const getNotLoopBackIpv4 = () => {
const ip = (0, ip_1.address)();
logger_1.logger.debug('local, ipv4: ', ip);
// 如果存在环回 ip,提示用户指定 ip
if ((0, ip_1.isLoopback)(ip)) {
logger_1.logger.error('Failed to obtain the local IPv4 address. Please try specifying the IPv4 address using the environment variable LPM_ORIGINAL_DEV_SERVER and then restart. Example: npx cross-env LPM_ORIGINAL_DEV_SERVER=<ipv4> lpm start');
process.exit(1);
}
return ip;
};
exports.getNotLoopBackIpv4 = getNotLoopBackIpv4;