英文:
TypeScript compilation error on windows OS
问题
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.
英文:
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.
答案1
得分: 2
我找到了一个解决方法,不指定编译器路径,并使用以下命令在Windows上运行它:
"npx tsc-watch --noClear --onSuccess \"node ./dist/src/index.js\""
英文:
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\""
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论