Answer the question
In order to leave comments, you need to log in
Why does the project startup script from package.json fail with an error?
When I try to run the script on windows, I get an error:
Error:
SyntaxError: Unexpected token ' in JSON at position 0
"ts-node --compiler-options '{\"module\": \"CommonJS\"}' ./server/bootstrap.ts"
Answer the question
In order to leave comments, you need to log in
Windows does not consider ' quotes and throws them as part of the parameter.
Escaping to make it work on all OSes is not so easy, and the result is ugly, so it is recommended to simply specify the parameters for overwriting under the key ts-node
in tsconfig.json
:
{
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
},
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question