0

I am running yarn start but it's sending an error like:

NODE_ENV=production PORT=8081 node dist/index.js 'NODE_ENV' is not recognized as an internal or external command,operable program, or batch file.error Command failed with exit code 1.

The script file is like:

"scripts": {
    "dev": "ts-node --project tsconfig.server.json server/index.ts",
    "build": "next build && tsc && tsc --project tsconfig.server.json",
    "start": "NODE_ENV=production PORT=8081 node dist/index.js",
    "lint": "eslint '{pages,src,server}//\*.{ts,tsx}' --fix",
    "lint-ts": "eslint '{pages,src,server}//\*.ts' --fix"
}
juliomalves
  • 42,130
  • 20
  • 150
  • 146
MH Pavel
  • 1
  • 1
  • Can you post the contents of your package.json file? I assume the error originates there. – arfi720 Mar 26 '22 at 23:19
  • I have not understood what you have said, please ask me in more details – MH Pavel Mar 26 '22 at 23:31
  • In the root directory of your project, there should be a file called package.json. This is where dependencies and start scripts and other configurations for a node or react project are declared. I suspect the error you are getting is coming from something in this file. If you post the contents of package.json I might be able to help further. – arfi720 Mar 27 '22 at 00:36
  • 1
    Are you on Windows? That syntax for setting environmental variables is for Unix-like systems (linux/mac). See [here](https://stackoverflow.com/questions/11928013/node-env-is-not-recognized-as-an-internal-or-external-command-operable-comman). – frabjous Mar 27 '22 at 01:01

0 Answers0