npm の global の保存先の変更 (ホームディレクトリに置くのが一番トラブルがなかった)
1.) Make a directory for global installations:
mkdir ~/.npm-global
2.) Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
3.) Update PATH
export PATH=~/.npm-global/bin:$PATH
Firebase (Cloud functions)
- firebase (https://console.firebase.google.com/) でプロジェクト作る
- npm install -g firebase-tools # ツールのインストール
- npm install -g firebase-admin
- firebase init
- firebase deploy
- sudo firebase serve --only functions
Update 作業
- npm install -g firebase-tools # 更新のインストール 何回か実行が必要な場合がある
Code
exports.homeAutomation = functions.https.onRequest((request, response) = > {
response.send("Hello from Firebase!");
});