TypeScript error TS5014: Unexpected token u in JSON at position 0

后端 未结 6 989
南方客
南方客 2021-01-07 19:11

I am trying to compile a .ts to .js

I have tsconfig.json as below

{
\"compilerOptions\": {
    \"target\": \"es5\",
    \"module\": \"co         


        
6条回答
  •  北恋
    北恋 (楼主)
    2021-01-07 19:31

    I would like to put in that you also see this error when you forgot to add 'typescript' as a dependency.

    npm install typescript
    

    should fix that.

    Note that this dependency is present in the package.json in the question.

提交回复
热议问题