将TypeORM添加到原始Javascript项目中,但出现此错误。该项目与webpack打包在一起,由弹出的create-react-app构建。
ColumnTypeUndefinedError: Column type for Commodity#name is not defined and
cannot be guessed. Make sure you have turned on an "emitDecoratorMetadata": true
option in tsconfig.json. Also make sure you have imported "reflect-metadata on
top of the main entry file in your application (before any entity imported). If
you are using JavaScript instead of TypeScript you must explicitly provide a
column type.
按照说明进行操作。看到反映在全球范围内。仍然出现错误。从这里建议采取什么步骤?
答案 0 :(得分:0)
@Column() 必须设置一个类型,比如@Column('text',{nullable:true}).