typescript: error TS2693: 'Promise' only refers to a type, but is being used as a value here

前端 未结 22 2608
猫巷女王i
猫巷女王i 2020-11-29 19:35

I am trying to use Typescript for my AWS Lambda and i am getting the following errors where ever I use promises.

error TS2693: \'Promise\' only refers to a type,          


        
22条回答
  •  [愿得一人]
    2020-11-29 19:59

    Please be aware that if you are running the tsc command with a file name ie:

    tsc testfile.ts
    

    then the tsconfig.json compiler configuration file is ignored. The solution is to run either the tsc command on its own, in which case all .ts files in the directory will be compiled, unless you have edited the tsconfig.json to include a set of files.

    see 'using the files property'... https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

提交回复
热议问题