我试图在文档中使用一个名为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系统信息。
发布于 2020-11-28 09:01:02
安装密码:
Npm install -i crypto
这将将丢失的模块安装到本地节点模块中。
发布于 2021-02-24 14:17:33
树对你的问题的评论:
systeminformation的依赖项,代码中也没有使用它。npm I systeminformation安装系统信息在安装过程中不显示任何错误?如果有错误,这应该很奇怪。tl;dr:系统信息包应该用作node.js后端/服务器端库,并且肯定不会在浏览器中工作。
希望这能说明问题。
https://stackoverflow.com/questions/63036991
复制相似问题