我正尝试在文档中使用名为systeminformation的npmjs模块,因为下面提供了该模块,但可以使用它,但它给了我一个未找到的错误模块
文档中的代码:
const si = require('systeminformation');
si.cpu()
.then(data => console.log(data))
.catch(error => console.error(error));
我的代码:
const si = require('systeminformation');
comp=()=>{
si.cpu()
.then(data => console.log(data))
.catch(error => console.error(error));
}
请帮助我,我尝试重新安装节点模块npm i systeminformation
安装加密货币:
Npm install -i crypto
这会将缺少的模块安装到本地节点模块