Help us understand the problem. What is going on with this article?

RaspberryPi2のCannot find module 'rpi-gpio'を解決した

More than 3 years have passed since last update.

目的:

RaspberryPi2とAE-BME280を利用し、
mBaaSのKiiに温度湿度気圧情報を格納する。

現象:

参考URL
https://docs.kii.com/ja/guides/external_services/mythings/device_preparation/raspberrypi_setup/
において

サンプルコード
https://github.com/KiiPlatform/thing-if-node-sample

test-gpio.js
実行時に
Error: Cannot find module 'rpi-gpio'
が発生する。

処置:

npm install rpi-gpio

でインストールを試すが、エラー出力

./npm-debug.log
を確認し、
epoll@0.1.21のインストールが必要であると確認

参考URL
https://github.com/fivdi/epoll/issues/14

より

sudo npm install -f --unsafe-perm node-gyp
sudo node-gyp rebuild
sudo npm install rpi-gpio --save

により正常にrpi-gpioのインストールが完了

sudo node test-gpio.js

が正常に動作した。

環境:

Hard:Raspberry Pi2 Model B
OS:RASPBIAN JESSIE WITH PIXEL
Release date:2017-01-11
Kernel version:4.4

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした