Giter Site home page Giter Site logo

Comments (5)

cjavilla-stripe avatar cjavilla-stripe commented on August 15, 2024

I'm not sure I follow the request. Do you mean update the package.json to use node server.js for the start command?

from subscription-use-cases.

lgs avatar lgs commented on August 15, 2024

The README says to use npm start for Node, but if you do it you'll got this errors:

lsoave@basenode:~/STRIPE/subscription-use-cases/fixed-price-subscriptions/server/node$ npm start server

> [email protected] start
> yarn server "server"

sh: 1: yarn: not found
lsoave@basenode:~/STRIPE/subscription-use-cases/fixed-price-subscriptions/server/node$ npm start start

> [email protected] start
> yarn server "start"

sh: 1: yarn: not found
lsoave@basenode:~/STRIPE/subscription-use-cases/fixed-price-subscriptions/server/node$ npm start test

> [email protected] start
> yarn server "test"

sh: 1: yarn: not found

because your package.json has yarn and npm mixed up ... which is confusing:

...
  "scripts": {
    "server": "node server/node/server.js",
    "reactClient": "cd client/react && npm start",
    "startReact": "concurrently \"yarn reactClient\" \"yarn server\"",
    "startVanillajs": "yarn server",
    "start": "yarn server",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
...

You also have two different package.json (also slightly different) in two different path:

lsoave@basenode:~/STRIPE/subscription-use-cases/fixed-price-subscriptions$ diff ./package.json server/node/package.json
2c2
<   "name": "stripe-subscription-with-fixed-price",
---
>   "name": "subscriptions-with-fixed-prices",
7,8c7,8
<     "server": "node server/node/server.js",
<     "reactClient": "cd client/react && npm start",
---
>     "server": "node server.js",
>     "reactClient": "cd ../../client/react && npm start",
24a25,27
>   },
>   "devDependencies": {
>     "@fullhuman/postcss-purgecss": "^2.1.2"

from subscription-use-cases.

lgs avatar lgs commented on August 15, 2024

I say, just use one or the other (and in one place only). In my case :

lsoave@basenode:~/STRIPE/subscription-use-cases/fixed-price-subscriptions/server/node$ cat ./package.json
{
  "name": "subscriptions-with-fixed-prices",
  "version": "1.0.0",
  "description": "A Stripe sample implementing cards for subscriptions with fixed prices.",
  "main": "server.js",
  "scripts": {
    "server": "node server.js",
    "reactClient": "cd ../../client/react && npm start",
    "startReact": "concurrently \"npm run reactClient\" \"npm run server\"",
    "startVanillajs": "npm run server",
    "start": "npm run server",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "stripe-demos",
  "license": "ISC",
  "dependencies": {
    "autoprefixer": "^9.7.6",
    "body-parser": "^1.19.0",
    "concurrently": "4.1.2",
    "cookie-parser": "^1.4.5",
    "dotenv": "^8.0.0",
    "express": "^4.17.1",
    "postcss-cli": "^7.1.1",
    "stripe": "^7.4.0"
  },
  "devDependencies": {
    "@fullhuman/postcss-purgecss": "^2.1.2"
  }
}


lsoave@basenode:~/STRIPE/subscription-use-cases/fixed-price-subscriptions/server/node$ npm start

> [email protected] start
> npm run server


> [email protected] server
> node server.js

Node server listening on port http://localhost:4242!

from subscription-use-cases.

lgs avatar lgs commented on August 15, 2024

But now I get the subscription process hanging forever.
I opened an issue here #100

from subscription-use-cases.

cjavilla-stripe avatar cjavilla-stripe commented on August 15, 2024

Removed the yarn dependencies and the postcss dependencies that aren't used anymore. Also added some error handling to the node example.

from subscription-use-cases.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.