I wanted to use TypeORM with my express app which is in JS and not TS.
Firstly is this possible?
If yes, then when I try using TypeORM I run into the following error:
@Entity()
^
SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
My entity file - Users.js
const typeorm = require("typeorm");
const Entity = typeorm.Entity;
const Column = typeorm.Column;
const PrimaryGeneratedColumn = typeorm.PrimaryGeneratedColumn;
@Entity()
module.exports = class Users {
@PrimaryGeneratedColumn
id: Number;
@Column()
name: String;
}
What can be done to fix this?