user17449555
user17449555

Reputation: 213

Running apollo Server for Next.js app giving error

As I am using graphql and need to run local server (Apollo server), I am struggling to setup for the Next.js project. I am totally a beginner . In order to run the apollo server, it says to create server.ts , which I have created at the root of the project folder as below: App - src - server - public

when I run 'npm start' , it gives error pm ERR! Missing script: "start" npm ERR! npm ERR! Did you mean one of these? npm ERR! npm star # Mark your favorite packages npm ERR! npm stars # View packages marked as favorites

Is there anything I need to change in tscofig?

Upvotes: 0

Views: 66

Answers (1)

Michel Floyd
Michel Floyd

Reputation: 20246

You need to define the start command in the scripts section of your package.json file.

Ex:

"scripts": {
  "compile": "tsc",
  "start": "npm run compile && node ./dist/index.js",
},

Upvotes: 2

Related Questions