質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

Q&A

解決済

1回答

1816閲覧

Macでnode.jsのv10をインストールできない

tima0314

総合スコア53

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

0グッド

0クリップ

投稿2022/04/17 05:11

fireabase開発でfunctions deploy時以下のエラーが

firebase学習中、初歩のfunctionsの利用をしてみようと以下のコードをdeployしたくdeployを実行。

index.js

1const functions = require("firebase-functions"); 2 3// // Create and Deploy Your First Cloud Functions 4// // https://firebase.google.com/docs/functions/write-firebase-functions 5// 6exports.helloWorld = functions.https.onRequest((request, response) => { 7 functions.logger.info("Hello logs!", {structuredData: true}); 8 response.send("Hello from Firebase!"); 9}); 10

そしたら以下のエラーが

takagifumiya@takagifumiyanoMacBook-Pro test % cd functions takagifumiya@takagifumiyanoMacBook-Pro functions % npm run deploy npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10. npm WARN npm You can find the latest version at https://nodejs.org/ > functions@ deploy /Users/takagifumiya/Desktop/test/functions > firebase deploy --only functions === Deploying to 'test-c9cc4'... i deploying functions i functions: ensuring required API cloudfunctions.googleapis.com is enabled... i functions: ensuring required API cloudbuild.googleapis.com is enabled... ✔ functions: required API cloudfunctions.googleapis.com is enabled ⚠ functions: missing required API cloudbuild.googleapis.com. Enabling now... Error: Your project test-c9cc4 must be on the Blaze (pay-as-you-go) plan to complete this command. Required API cloudbuild.googleapis.com can't be enabled until the upgrade is complete. To upgrade, visit the following URL: https://console.firebase.google.com/project/test-c9cc4/usage/details npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! functions@ deploy: `firebase deploy --only functions` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the functions@ deploy script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/takagifumiya/.npm/_logs/2022-04-17T04_20_57_769Z-debug.log

調べた所、”プランをblazeにアップデートしろ”とのこと、
いやいや調べによるとcloud functionsは無料でできると聞かされていたのでおかしいと思いさらに調べると、”nodeのバージョンが10じゃないとダメだよ”みたいな記事を見ました。確かに私のnodeバージョンはv12.16.1でした。そしてnode v10系をインストールすることに。

node 10系をインスールできない

ここからが本題なのですが私のpcはmac m1なのですが、m1ではnodebrewを利用しても普通にインストールできなくcompileしなくてはいけないと知っていました。そこで以下のコマンドを実行

nodebrew compile v10.0.0

そしたらこんなエラーが

./configure: line 3: exec: python: not found

このエラーが解決出来なく詰まっています。どなたかこのエラーの解決法を教えてください。 

環境

Mac M1
node v12.16.1
nodebrew v8.9.4
vdcode

その他ファイル

firebase.json

1{ 2 "functions": { 3 "source": "functions", 4 "runtime": "nodejs12" 5 }, 6 "database": { 7 "rules": "database.rules.json" 8 }, 9 "firestore": { 10 "rules": "firestore.rules", 11 "indexes": "firestore.indexes.json" 12 }, 13 "hosting": { 14 "public": "public", 15 "ignore": [ 16 "firebase.json", 17 "**/.*", 18 "**/node_modules/**" 19 ], 20 "rewrites": [ 21 { 22 "source": "**", 23 "destination": "/index.html" 24 } 25 ] 26 }, 27 "storage": { 28 "rules": "storage.rules" 29 }, 30 "emulators": { 31 "auth": { 32 "port": 9099 33 }, 34 "functions": { 35 "port": 5001 36 }, 37 "firestore": { 38 "port": 8080 39 }, 40 "database": { 41 "port": 9000 42 }, 43 "hosting": { 44 "port": 5000 45 }, 46 "pubsub": { 47 "port": 8085 48 }, 49 "storage": { 50 "port": 9199 51 }, 52 "ui": { 53 "enabled": true 54 } 55 }, 56 "remoteconfig": { 57 "template": "remoteconfig.template.json" 58 } 59}

fnctions/package.json

1{ 2 "name": "functions", 3 "description": "Cloud Functions for Firebase", 4 "scripts": { 5 "lint": "eslint .", 6 "serve": "firebase emulators:start --only functions", 7 "shell": "firebase functions:shell", 8 "start": "npm run shell", 9 "deploy": "firebase deploy --only functions", 10 "logs": "firebase functions:log" 11 }, 12 "engines": { 13 "node": "12" 14 }, 15 "main": "index.js", 16 "dependencies": { 17 "firebase-admin": "^10.0.2", 18 "firebase-functions": "^3.18.0" 19 }, 20 "devDependencies": { 21 "eslint": "^8.9.0", 22 "eslint-config-google": "^0.14.0", 23 "firebase-functions-test": "^0.2.0" 24 }, 25 "private": true 26} 27 28

よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hoshi-takanori

2022/04/17 06:05

> npm WARN npm npm does not support Node.js v12.16.1 うーん、npm が古いのでは…。npm -v で npm のバージョンをご確認ください。 また、fnctions/package.json に "engines": { "node": "12" }, とあるので、node v12 用のプロジェクトですね。 > 調べた所、”プランをblazeにアップデートしろ”とのこと、 Firebase functions は Blaze プランが必須になってたような…。 https://qiita.com/azukiazusa/items/edd6ca9cba2d48c4c3e2
tima0314

2022/04/18 11:42

すいません。改めれ調べるとfunctionsはBlaze必須ぽいですね。 古いサイト見ていました。 ありがとうございました。
guest

回答1

0

自己解決

私の勘違いでした。functionsはBlazeプランでしか使えないみたいです。
失礼しました。

投稿2022/04/18 11:43

tima0314

総合スコア53

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問