错误!在 raspberry Pi 3 模型 b 上安装节点串行端口
ERROR! Installing node serialPort On raspberry Pi 3 model b
我正在用 raspberry Pi 和 arduino.in
做一个物联网项目,在这种情况下,我需要同时使用 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:~#
错误截图:
raspberry pi3款B板有最新RASPBIANOS.
将 npm 更新到对我有用的最新版本:
npm install -g npm@latest
和::
"npm install -g --unsafe-perm serialport"
在 raspbian 安装中使用了 node 和 npm 版本,但出现与您描述的相同的错误:
npm ERR! System Linux 4.14.69-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "serialport"
npm ERR! cwd /var/www/html/plugins/rflink/resources
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
我正在用 raspberry Pi 和 arduino.in
做一个物联网项目,在这种情况下,我需要同时使用 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:~#
错误截图:
raspberry pi3款B板有最新RASPBIANOS.
将 npm 更新到对我有用的最新版本:
npm install -g npm@latest
和:: "npm install -g --unsafe-perm serialport"
在 raspbian 安装中使用了 node 和 npm 版本,但出现与您描述的相同的错误:
npm ERR! System Linux 4.14.69-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "serialport"
npm ERR! cwd /var/www/html/plugins/rflink/resources
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405