環境
ラズパイ3 + nでnpmインストール済み
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
$ n --version
2.1.7
npm -v
5.6.0
node -v
v9.10.1
プロジェクト名はfirebase-realtime-database-watcher
とします。
やろうとしたこと
firebase-tools
ではなくfirebase
の方を入れようとした。
sudo npm i -S firebase
sudo を付けないとエラーになる
sudoを付けても以下が延々と流れてインストールが終わらない
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/pi/dev/firebase-realtime-database-watcher/node_modules/grpc/.node-gyp/9.10.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/dev/firebase-realtime-database-watcher/node_modules/grpc/.node-gyp"
.
.
.
延々とループ
結論
プロジェクトディレクトリをroot権限にする
sudo chown -R root firebase-realtime-database-watcher/
sudo 付けないと可されていない操作です
と怒られます。
node-gypをインストールする
sudo npm i -g node-gyp
これで準備完了
改めてインストール
sudo npm i firebase
無事インストールできた!
備考
firebaseだけインストールしてもfirebase-tools
がないと意味なかったので、結局firebase-tools
もインストールした。
追記
node-gypが必要かと思ってたが改めて作業すると関係なかった
必要でした、node-gyp
インストールを追加。