I am new to Angular ,Here in my project I need to get the MAC address of the user's system .
For that I have executed a NPM as follows
npm install --save macaddress
Added the below code after the imports in my app.component.ts file
var macaddress = require('macaddress');
And this in my ngOnInit
macaddress.one(function (err, mac) {
console.log("Mac address for this host: %s", mac);
});
After adding all these code and I tried to Serve the project but I got the below error .
ERROR in ./node_modules/macaddress/lib/windows.js
Module not found: Error: Can't resolve 'child_process' in 'D:\Projects\Angular\eCommerceWebsite\node_modules\macaddress\lib'
ERROR in ./node_modules/macaddress/lib/unix.js
Module not found: Error: Can't resolve 'child_process' in 'D:\Projects\Angular\eCommerceWebsite\node_modules\macaddress\lib'
ERROR in ./node_modules/macaddress/lib/linux.js
Module not found: Error: Can't resolve 'child_process' in 'D:\Projects\Angular\eCommerceWebsite\node_modules\macaddress\lib'
ERROR in ./node_modules/macaddress/index.js
Module not found: Error: Can't resolve 'os' in 'D:\Projects\Angular\eCommerceWebsite\node_modules\macaddress'
After executed the npm install --save macaddress
I executed the npm install -g
But I can't solve this error ,Can anyone help me to solve this please.