Home > Net >  TypeScript compilation error on windows OS
TypeScript compilation error on windows OS

Time:01-06

I have created a command in package.json using tsc-watch which is shown below:

npx tsc-watch --noClear --compiler ./node_modules/.bin/tsc --onSuccess 'node ./dist/src/index.js'

This works perfectly fine on mac but when I run it inside windows it throw below error:

\node_modules\.bin\tsc:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list

Not sure if there is anything wrong with compiler path or anything I am missing.

Thanks in advance.

CodePudding user response:

I found a workaround by not specifying the compiler path and used below command to run it on windows:

"npx tsc-watch --noClear --onSuccess \"node ./dist/src/index.js\""
  • Related