7

Node project is built with Typescript and there are three script in package.json file but when I run it shows ...

If i run this project in ubuntu it works fine but not in windows

Image of output terminal

but after this nodemon is not start to run project.

Script in Package.json

"start": "tsc --watch & nodemon dist/index.js",
"lint": "tslint -c tslint.json 'src/**/*.ts' --fix",
"build": "tsc"

Help me to solve this, Thank you in advance :)

Jimit Raval
  • 75
  • 1
  • 10

1 Answers1

9

You seem to be missing an & character between tsc --watch and nodemon dist/index.js. A single & is not a valid and operator:

"start": "tsc --watch && nodemon dist/index.js",

Update It looks like the issue is on Windows. Commonly this issue is solved by using a library such as concurrently or cross-env to execute commands in a similar way on Windows. After you've installed concurrently:

"start": "concurrently \"tsc --watch\" \"nodemon dist/index.js\"",

Hopefully that helps!

Alexander Staroselsky
  • 37,209
  • 15
  • 79
  • 91