amazon-archives / awsmobile-cli

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

awsmobile projects do not translate well across git pull/push. #103

Closed michaelcuneo closed 6 years ago

michaelcuneo commented 6 years ago

I've got a project I work on at work. On the weekends I sometimes wish to take a look at it, but the version I have here at home, doesn't function. awsmobile errors all the time. There is either no project in the folder, or no such file or directory on certain files, reinitialising it just messes it up completely, and I've never been able to get it to work in two places at once. Isn't this stage-able at all?

UnleashedMind commented 6 years ago

Sorry to hear that Michael. Could you please provide more detailed description of the problems that you have encountered? So we can help you to find the best way to resolve the issues. Please let us know the version of the cli and the exact error messages.

michaelcuneo commented 6 years ago

The version is the same on both sides. I'm literally pushing the project with git... then pulling it at home. Standard .gitignore for a react environment. The only difference would be maybe slight version differences in NPM/Node. I'm solving the problem by dockerising the project, shoudn't have any issues then. But... before I start work when I get home later, I'll read the errors. The first error was 'This folder doesn't contain a mobilehub project.' ... second error was related to missing files.

UnleashedMind commented 6 years ago

It's recommended that you get the latest CLI (v.1.1.1) first. After you pull your project at home, cd to the project root folder and execute 'awsmobile init ' to set up the connection with your backend mobile hub project. You can find the mobile hub project id by going to the mobile hub console and choose your mobile hub project, the id appears in the url.

michaelcuneo commented 6 years ago

I did that... the result was the following.

`awsmobile init 18c099e2-9702-42ad-b1ac-8a 74fa6a185c

/usr/local/lib/node_modules/awsmobile-cli/lib/init-steps/s2-choose-strategy.js:1 04 async function inquirerForValid(initInfo){ ^^^^^^^^

SyntaxError: Unexpected token function at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:549:28) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.require (module.js:504:17) at require (internal/module.js:20:19) at Object. (/usr/local/lib/node_modules/awsmobile-cli/lib/command -init.js:16:24) `

michaelcuneo commented 6 years ago

Looks like it might be my setup somewhere... I just installed a brand new react.js project at home. ran awsmobile init ... and the exact same error occurred.

michaelcuneo commented 6 years ago

It's o.k. I fixed my environment, for some reason I had an old version of Node... dunno what happened there.

UnleashedMind commented 6 years ago

I'm glad it's worked out for you. The cli requires node v7 + (prefers node 8.9.0), because it is using async/await.

kaustavghosh06 commented 6 years ago

Closing this since it's resolved, please feel free to re-open if you still have issues.