amazon-archives / awsmobile-cli

CLI experience for Frontend developers in the JavaScript ecosystem.
Apache License 2.0
142 stars 35 forks source link

The 'you are not working inside a valid awsmobilejs project' error occurs after a pull from git #83

Closed shurmanidze closed 6 years ago

shurmanidze commented 6 years ago

I've created a project using awsmobile CLI and pushed it to my git repo. Once I pull the repo on my another PC and try to run it I get this:

$ awsmobile run

you are not working inside a valid awsmobilejs project

As I see it checks the project-info.json file that is in .gitignore:

#awsmobilejs
aws-info.json
project-info.json
aws-exports.js
awsmobilejs/.awsmobile/backend-build
awsmobilejs/\#current-backend-info
~awsmobilejs-*/
UnleashedMind commented 6 years ago

you have to run awsmobile init <backenc-mobile-project-id> on the project after you pull it, then it becomes a valid awsmobilejs project. The reason behind it is that backend mobile project are not considered public during development, so different collaborators can have their own version of it. For your case, you can just link to the existing mobile project as the backend, hence the project id.

shurmanidze commented 6 years ago

Thanks, it's working this way. BTW is there the project-id somewhere in the Console UI? I managed to find it just in the project details page URL.

UnleashedMind commented 6 years ago

It appears in the console url as you've found. It's not in the UI. And if you don't specify the mobile hub project id with the init command, the cli will create another mobile hub project as the backend with the specification inside the awsmobile/backend folder

UnleashedMind commented 6 years ago

closing the issue for now, feel free to open other issues for questions or bugs.