【发布时间】:2019-01-11 08:47:02
【问题描述】:
我正在使用 raspberry Pi 和 arduino.in 做一个 IoT 项目,在这种情况下,我需要同时使用 WebSocket 和 SerialPort 模块。因为这些模块需要与 Samsung Artik 通信。但问题是当我尝试安装serialPort 时,它不断出现以下错误。我在所有 GitHub 论坛中寻找解决方案,但它们都不起作用。有没有人为此找到解决方案?提前致谢。有关节点版本和其他详细信息,请参阅错误日志。
pi@raspberrypi:~ $ sudo -i
SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
root@raspberrypi:~# sudo npm install -g --unsafe-perm serialport
(node:1740) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpd ir() instead.
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.j s:167:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 4.14.50-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "--unsafe-perm" " serialport"
npm ERR! cwd /root
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm ERR! not ok code 0
root@raspberrypi:~# ^C
root@raspberrypi:~#
错误截图:
树莓派 3 型号 B 板具有最新的 RASPBIAN 操作系统。
【问题讨论】:
标签: node.js raspberry-pi raspberry-pi3 iot node-serialport