tadashi-aikawa / togowl

Togowl for next generation owls :owl:
5 stars 0 forks source link

Can't npm run deploy #13

Open Akiyam-hub opened 2 years ago

Akiyam-hub commented 2 years ago

初めまして,今回開発してくださったこちらのツールに大変興味を抱かせていただきました.

そこで試しに利用しようと試みたのですがDeployをしてもnpm ERRにより正常に使うことができません.

使用環境

MacOS:BigSur 11.6 node:v14.18.2 npm: 6.14.15

行ったこと

表示されるエラー

$ npm run deploy 

Error: Failed to get Firebase project togowl. Please make sure the project exists and your account has permission to access it.

ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! togowl@2.28.0 deploy: `firebase deploy`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the togowl@2.28.0 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/username/.npm/_logs/2021-12-01T10_26_31_709Z-debug.log

試したこと

キャッシュのクリア

$ rm -rf node_modules 
$ npm cache clean --force
$ npm install

結果:解決せず

tadashi-aikawa commented 2 years ago

デプロイ先のFirebaseプロジェクトが存在しない、またはアクセス権限がなさそうですね。

ご自分のFirebaseアカウントで、Firebaseプロジェクトは作成されている..という認識でよろしいでしょうか? https://github.com/tadashi-aikawa/togowl#create-your-app-on-firebase

Akiyam-hub commented 2 years ago

ご自分のFirebaseアカウントで、Firebaseプロジェクト

はい ここではakitogowlとして作成させていただきました.

Screen Shot 2021-12-01 at 19 57 40 Screen Shot 2021-12-01 at 20 02 21

その後.firebase.config.sample.jsonを参考に.firebase.config.jsonを作成しました.

tadashi-aikawa commented 2 years ago

projectId など赤枠の部分は togowl ではなく akitogowl になっていますでしょうか?

image

Akiyam-hub commented 2 years ago

はい.いずれもAkitogowlとなっております

ちなみにユーザー権限はオーナーとなっています

tadashi-aikawa commented 2 years ago

こちらのjsonの内容をそのまま使うだけで大丈夫なはずなのですが..。

image

近々、セキュリティ周りのパッチアップデートをする予定ですので、そのときにデプロイできるか試してみます。

tadashi-aikawa commented 2 years ago

@Akiyam-hub .firebaserc の設定値が原因な気がします..。ここを変えていただければいけそうかと。

$ cat .\.firebaserc
{
  "projects": {
    "default": "togowl"
  }
}
Akiyam-hub commented 2 years ago
Screen Shot 2021-12-02 at 9 50 48

このような記述でよろしいでしょうか

再設定後にfirebase のログアウト,キャッシュの削除をしてDeployを試みましたが'ERR'は変わりません.

追記 記入忘れていた '"databaseURL": "https://{akitogowlと記入}.appspot.com",'  も入れましたがそちらでも変わりませんでした.

tadashi-aikawa commented 2 years ago

Error: Failed to get Firebase project togowl. Please make sure the project exists and your account has permission to access it.

↑と全く同じメッセージが表示されますか? (特に togowl のところです)

Akiyam-hub commented 2 years ago

> togowl@2.28.0 deploy /Users/username/togowl
> firebase deploy

=== Deploying to 'akitogowl'...

i  deploying firestore, hosting
i  firestore: reading indexes from firestore.indexes.json...
i  cloud.firestore: checking firestore.rules for compilation errors...
✔  cloud.firestore: rules file firestore.rules compiled successfully

Error: Specified "public" directory "dist" does not exist, can't deploy hosting to site "akitogowl"
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! togowl@2.28.0 deploy: `firebase deploy`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the togowl@2.28.0 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/username/.npm/_logs/2021-12-02T01_05_16_852Z-debug.log

こちらが現在のエラーです

tadashi-aikawa commented 2 years ago

成果物がないのでエラーになっています。 npm run build をお願いします。

Akiyam-hub commented 2 years ago

ご返信ありがとうございます. run buildなどはできましたがdeployはERRが続くので一度プロジェクトをクリーンにして再び試みてみます

firebase上でアプリを作成する際に注意しておきたい設定はあるでしょうか?

tadashi-aikawa commented 2 years ago

いえ、私が把握している限り他の手順は問題なさそうです。(作成が数年前なのでFirebaseの仕様が変わっている可能性はありそうですが...)

deployはERRが続く

こちらのエラーログを見てみないと分からないため、必要あれば共有いただければと思います。

Akiyam-hub commented 2 years ago

以下を実行しました

$ npm run deploy

togowl@2.28.0 deploy /Users/~/togowl firebase deploy

Error: Failed to get Firebase project akitogolws. Please make sure the project exists and your account has permission to access it. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! togowl@2.28.0 deploy: firebase deploy npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the togowl@2.28.0 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/~/.npm/_logs/2021-12-05T02_43_56_405Z-debug.log

tadashi-aikawa commented 2 years ago

Error: Failed to get Firebase project akitogolws.

akitogowls ではなく akitogolws になってそうです。

Akiyam-hub commented 2 years ago

akitogowlsを有効にし, Cloud API Managerを有効にしました

実行しましたがこちらのようになりました

=== Deploying to 'akitogowls'...

i  deploying firestore, hosting
i  firestore: reading indexes from firestore.indexes.json...
i  cloud.firestore: checking firestore.rules for compilation errors...
✔  cloud.firestore: rules file firestore.rules compiled successfully

Error: HTTP Error: 404, Project 'akitogowls' does not exist.

Having trouble? Try firebase [command] --help
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! togowl@2.28.0 deploy: `firebase deploy`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the togowl@2.28.0 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/~/.npm/_logs/2021-12-05T04_47_28_369Z-debug.log
tadashi-aikawa commented 2 years ago

以前は akitogowl になっていましたが、Firebaseプロジェクトの名前も akitogowls であっていますか?

https://github.com/tadashi-aikawa/togowl/issues/13#issuecomment-984196013

Akiyam-hub commented 2 years ago

はい,その後再びプロジェクトを削除して aktogowls にして同じ手順を行なっていますが同じ状態です.

tadashi-aikawa commented 2 years ago

それであれば問題なさそうですね.. 🤔

aktogowls となってますが akitogowls のタイプミスということでよろしいですよね・・?

Akiyam-hub commented 2 years ago

aktogowls となってますが akitogowls のタイプミスということでよろしいですよね・・?

あの後こちらの操作で

Firebase Cloud Firestoreを作成時に誤ってDatastoreをつかったことにより This operation is not available for Cloud Firestore projects in Datastore modeが出てしまったので再びプロジェクトを新規に作成して行いました.

今度は無事に

=== Deploying to 'aktogowls'...

i  deploying firestore, hosting
i  firestore: reading indexes from firestore.indexes.json...
i  cloud.firestore: checking firestore.rules for compilation errors...
✔  cloud.firestore: rules file firestore.rules compiled successfully
i  firestore: uploading rules firestore.rules...
✔  firestore: deployed indexes in firestore.indexes.json successfully
i  hosting[aktogowls]: beginning deploy...
i  hosting[aktogowls]: found 40 files in dist
✔  hosting[aktogowls]: file upload complete
✔  firestore: released rules firestore.rules to cloud.firestore
i  hosting[aktogowls]: finalizing version...
✔  hosting[aktogowls]: version finalized
i  hosting[aktogowls]: releasing new version...
✔  hosting[aktogowls]: release complete

✔  Deploy complete!

が表記し成功することができました.

こちら側の誤字や未設定な箇所が原因でした.

真摯に対応してくださったことに感謝いたします.🙇

tadashi-aikawa commented 2 years ago

正常にデプロイできたようで良かったです!

Togowlでログインするには、Firebaseからメールアドレスベースの認証情報を作成する必要があります。

また、その後にTodoistやToggl、Slackと通信するとき、CORSエラーに悩まされるかもしれません。私の場合はAWSのLightsailにnginxでproxyサーバーを立てることによって回避しています。設定が少し難しいので、もし必要でしたら仰ってください。

上記は面倒なので、とりあえず軽く試してから、使えそうならしっかり準備したい... という場合は、私が立てたProxyサーバーをそれまでの間、ご利用いただいても構いません。必要な場合は、TwitterのDMなどでURLをお伝えします。

Akiyam-hub commented 2 years ago

ありがとうございます.

Togowlでログインするには、Firebaseからメールアドレスベースの認証情報を作成する必要があります。

これはAuthenticationでメールとパスワードを登録してからnpm run build--->npm run test:e2eをするということでよろしいでしょうか?

tadashi-aikawa commented 2 years ago

いえ、Authenticationでメールとパスワードを登録したら、その情報を使ってデプロイしたTogowlにてログインできます。

npm run test:e2e はe2eテストのコマンドです

Akiyam-hub commented 2 years ago

恐れ入ります. 登録後,試したところ undefined: Cannot read properties of undefined (reading 'name') と表記されました.

追記 失礼します.あれから何度か試してみたのですが解決しませんでした.

登録したはずのユーザー情報が認識されていないようでした