Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Ubuntu 20.04 with wifi off #38

Open
chetbox opened this issue Sep 29, 2021 · 0 comments
Open

Error on Ubuntu 20.04 with wifi off #38

chetbox opened this issue Sep 29, 2021 · 0 comments
Assignees

Comments

@chetbox
Copy link

chetbox commented Sep 29, 2021

Hi! Firstly, thanks for this great library!

I got this error using macaddress 0.5.2 on Ubuntu 20.04, but only when I turn off wifi . It looks to me like the output of a command isn't being parsed properly:

Failed to get MAC address [
  "Error: invalid iface: 'enx00e04d3a478a\n" +
    'lo\n' +
    "wlp0s20f3' (must conform to reg exp //^[a-z0-9]+$/i/)\n" +
    '    at Object../node_modules/macaddress/lib/getmacaddress.js.module.exports [as getMacAddress] (http://localhost:3000/account/index.js:102475:18)\n' +
    ...

The code that give this error looks like this:

import { one as macAddress } from 'macaddress';

async function foo() {
    try {
      return `MAC:${await macAddress()}`;
    } catch (error) {
      console.warn('Failed to get MAC address', error);
    }

    // return something else
    // ...
}

In our case we use the MAC address as a machine identifier but this means we cannot identify the machine when it is offline.

@scravy scravy self-assigned this Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants