I want to use macAddress in reactJS Component. But when I am using the getmac package i am getting error. Can any one help me to do this or refer any documentation about macAddress. [Package Error] [1]: https://i.stack.imgur.com/kV0hr.png
Asked
Active
Viewed 857 times
1 Answers
0
Look at the documentation for the module you are using.
This library will not run in web browsers / on the client-side / in webpack / in browserify / in angular / in react / in jQuery / in HTML. It will only run on Node.js environments, which the web browser is not.
There is no API in the browser that will expose the machine's MAC addresses to client-side JavaScript.
The closest you could come would be to write a web service (in the server-side programming language of your choice) which looked up the MAC address from the IP address the request came from. This would only work within a local network environment.

Quentin
- 914,110
- 126
- 1,211
- 1,335