Why is the project launch script from package.json crashing?

  • 0
    When trying to run a script on windows, an error occurs:

    Error:
    SyntaxError: Unexpected token ' in JSON at position 0


    Command:
    "ts-node --compiler-options '{\"module\": \"CommonJS\"}' ./server/bootstrap.ts"


    How can this be fixed?
    JavaScript August Fitzgerald, Jan 30, 2020

  • 1 Answers
  • 0
    Windows does not consider 'quotes' and throws them as part of the parameter.

    Escaping so that it works on all OS is not so easy, and the result is ugly, so it is recommended to just specify the parameters for rewriting under the ts-node key in tsconfig.json : [ [[0_0]]]
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!