Warm tip: This article is reproduced from serverfault.com, please click

Node JS Module Not Working . Module Not Found

发布于 2020-07-22 14:45:55

I Am Trying To Use An npmjs module named systeminformation in the documentation it is given to use it as it is down below but it gives me an error module not found

the code from documentation:

const si = require('systeminformation');

 si.cpu()
   .then(data => console.log(data))
   .catch(error => console.error(error));

My Code :

const si = require('systeminformation');

comp=()=>{
    si.cpu()
        .then(data => console.log(data))
        .catch(error => console.error(error));
    }

please help me with this I tried reinstalling the node module npm i systeminformation

The NpmJS Module -- https://www.npmjs.com/package/systeminformation

Questioner
Belgin Android
Viewed
0
PDHide 2020-11-28 17:01:02

Install crypto:

Npm install -i crypto

This will install missing module to your local node modules