getMa c npm angular cli - PullRequest
       68

getMa c npm angular cli

0 голосов
/ 14 июля 2020

Я установил это:

npm install --save getmac

и вставил в мой home.components.ts этот код

import getMAC, { isMAC } from 'getmac';

и в ngOnInit этот текст кода:

console.log(getMAC());

Ошибка консоли:

core.js:5873 ERROR Error: failed to get the MAC address
at getMAC (index.js:37)
at HomeComponent.ngOnInit (home.component.ts:15)
at callHook (core.js:3937)
at callHooks (core.js:3901)
at executeInitAndCheckHooks (core.js:3842)
at refreshView (core.js:11795)
at refreshDynamicEmbeddedViews (core.js:13142)
at refreshView (core.js:11800)
at refreshComponent (core.js:13217)
at refreshChildComponents (core.js:11508)

Где я ошибаюсь?

...