I am new to Angular 5 ,as per my business need I need to get the user machine's mac address.For that I tried to implement the following...
Reference: https://www.npmjs.com/package/macaddress
npm install --save macaddress
I have added this package using NPM and the following code in my typescript file .
var macaddress = require('macaddress'); //added this code below my imports
ngOnInit() {
macaddress.one(function (err, mac) {
console.log("Mac address for this host: %s", mac);
});
}
After adding this codes I can't run my project and it showing a black screen with the above error .
Can anyone help me to fix this please.
Edit : ./node_modules/macaddress/lib/windows.js Module not found: Error: Can't resolve 'child_process' in 'D:\Projects\Angular\eCommerceWebsite\node_modules\macaddress\lib' errors @ vendor.js:158535
got this in console.
Update :