stripe/stripe-billing-typographic

Instructions to run backend

Closed this issue · 7 comments

Hi Mike! I have been working on the code you prepared for the Stripe Billing (Typographic). But I am having problems with the the instructions to run the project.
Seems that the config for the Front End is on the readme but not for the back end. Maybe I am missing something. If you could, please, help me here, I would appreciate. Thanks!

Hey, @MikeThmz, sorry for not replying sooner!

From the README, all you need to configure the backend is the dotenv file (just make sure to include your own Stripe API key):

Copy the example .env file. You'll need to fill out two details:

  • Your Stripe API keys
  • A random 20-character string to keep user authentication secure (using JSON Web Tokens)
cp .env.example .env

Once the environment variables are set, the app should be as easy to start as:

npm run setup
npm start

Thanks @mg-stripe for your response!
Maybe I am missing something on the process (or in my setup). I have copied the .env file and run the npm run setup. Look below the error I got after running the npm run setup:

/Users/myuser/Workspace/stripe-billing-typographic/setup.js:41
  async checkTables() {
        ^^^^^^^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! typographic@1.0.0 setup: `node setup.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the typographic@1.0.0 setup 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/myuser/.npm/_logs/2018-07-01T12_07_31_717Z-debug.log

Any suggestion here, please?
Thanks!

@MikeThmz: What version of Node are you running? You can check with node -v.

Hi @mg-stripe, version v6.11.3

@MikeThmz: You'll need to update your Node installation to a more recent version (at least Node v8) to run this app. (This is because it uses some modern Node features like async/await.)

Thanks @mg-stripe !
Everything worked fine now. It was my fault. I have downgraded node for another test and forgot.
Appreciate your help here!
You can close the issue.

Glad we sorted everything out! 😄