安装:npm install node-machine-id
yarn add node-machine-id
const {machineId, machineIdSync} = require('node-machine-id'); console.log(machineIdSync()); // 4867a008adfe5974b57e75e1ffb8b868efe642023406db43e8d5edfea50d8c0b // 4867a008adfe5974b57e75e1ffb8b868efe642023406db43e8d5edfea50d8c0b machineId().then(data => { console.log(data); });