如何在 RasperryPi3 上安装“rpi-dht-sensor”而不会出错?

问题描述

我当前的一个项目遇到了问题,该项目旨在将数据从传感器实时传输到平台。它是一个 DHT22 传感器,能够测量温度和湿度。一种可能性是将数据直接从 RaspBerryPi 传输到平台。为了做到这一点,我遵循了本教程:https://github.com/SAPDocuments/Tutorials/blob/master/tutorials/iot-express-3-configure-device/iot-express-3-configure-device.md。到目前为止一切顺利。

但是我在输入这个命令后遇到了一个问题:

npm install --save rpi-dht-sensor

调试代码末尾有很多错误

152 warn enoent ENOENT: no such file or directory,open '/home/pi/Downloads/package.json'
153 verbose enoent This is related to npm not being able to find a file.
154 warn Downloads No description
155 warn Downloads No repository field.
156 warn Downloads No README data
157 warn Downloads No license field.
158 verbose stack Error: rpi-dht-sensor@0.1.1 install: `node-gyp rebuild`
158 verbose stack Exit status 1
158 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
158 verbose stack     at EventEmitter.emit (events.js:315:20)
158 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
158 verbose stack     at ChildProcess.emit (events.js:315:20)
158 verbose stack     at maybeClose (internal/child_process.js:1048:16)
158 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
159 verbose pkgid rpi-dht-sensor@0.1.1
160 verbose cwd /home/pi/Downloads
161 verbose Linux 5.10.17-v7l+
162 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--save" "rpi-dht-sensor"
163 verbose node v14.16.0
164 verbose npm  v6.14.11
165 error code ELIFECYCLE
166 error errno 1
167 error rpi-dht-sensor@0.1.1 install: `node-gyp rebuild`
167 error Exit status 1
168 error Failed at the rpi-dht-sensor@0.1.1 install script.
168 error This is probably not a problem with npm. There is likely additional logging output above.
169 verbose exit [ 1,true ]

由于我对编程知之甚少,我正在努力寻找解决此问题的方法。也许这里有人可以帮助我。

提前致谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)