なぜかデプロイできない
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run build
> build
> tsc
✔ functions: Finished running predeploy script.
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ artifactregistry: required API artifactregistry.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing codebase default for deployment
⚠ functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
⚠ functions: You are using an old version of firebase-functions SDK (3.15.4). Please update firebase-functions SDK to >=3.20.0
i functions: preparing functions directory for uploading...
i functions: packaged /Users/gen/Desktop/basic/hCalendar/functions (71.91 KB) for uploading
i functions: ensuring required API cloudscheduler.googleapis.com is enabled...
✔ functions: required API cloudscheduler.googleapis.com is enabled
✔ functions: functions folder uploaded successfully
i functions: creating Node.js 10 function scheduledFirestoreExport(asia-northeast2)...
⚠ functions: failed to create function projects/hcalendar-7c1f4/locations/asia-northeast2/functions/scheduledFirestoreExport
Failed to create function projects/hcalendar-7c1f4/locations/asia-northeast2/functions/scheduledFirestoreExport
Functions deploy had errors with the following functions:
scheduledFirestoreExport(asia-northeast2)
i functions: cleaning up build files...
Error: There was an error deploying functions
i functions: cleaning up build files...
は一体何ですか???
# Get the latest version of the firebase command
npm install -g firebase-tools
# Unlock the deletegcfartifacts command
firebase --open-sesame deletegcfartifacts
# Run a full purge of your GCF artifacts directories
firebase functions:deletegcfartifacts
こちらを試してみるも変換なし・・・。
よくみるとfirebase-functions SDKのバージョンアップを求められていた!
⚠ functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
⚠ functions: You are using an old version of firebase-functions SDK (3.15.4). Please update firebase-functions SDK to >=3.20.0
これだ!!!
/path_to_your_project/functions
のように、ターミナルの現在地をfunctionsの階層へ移動して
sudo npm install --save firebase-functions@latest
これを実行すればfunctionsのデプロイに成功しました!!!