E:Nodejs TrainingNodejs CodeWeek3> npm run build
[email protected] build
tsc
PS E:Nodejs TrainingNodejs CodeWeek3> npm run start
[email protected] start
node dist/app.js
The server is running on port 8080
Executing (default): SELECT 1+1 AS result
Executing (default): SELECT table_name FROM information_schema.tables WHERE table_schema = ‘public’ AND table_name = ‘users’
Database connection established successfully.
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = ‘r’ and t.relname = ‘users’ GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Models synchronized with the database.
E:Nodejs TrainingNodejs CodeWeek3node_modulessequelizelibmodel.js:1368
}).save(options);
^
TypeError: this.build(…).save is not a function
at User.create (E:Nodejs TrainingNodejs CodeWeek3node_modulessequelizelibmodel.js:1368:8)
at E:Nodejs TrainingNodejs CodeWeek3distservice.js:19:52
at Generator.next ()
at E:Nodejs TrainingNodejs CodeWeek3distservice.js:8:71
at new Promise ()
at __awaiter (E:Nodejs TrainingNodejs CodeWeek3distservice.js:4:12)
at createUser (E:Nodejs TrainingNodejs CodeWeek3distservice.js:15:12)
at E:Nodejs TrainingNodejs CodeWeek3distapp.js:23:36
at Generator.next ()
at E:Nodejs TrainingNodejs CodeWeek3distapp.js:8:71
Node.js v20.11.1
Tried making changes in code related to sequelize, also checked the importing paths in code still unable to find what exactly is the error.I am getting error while using get method.
And to check post method in postman i have passed data in json was
[
{
“id”: “1”,
“name”: “Adi”,
“email”: “[email protected]”
},
{
“id”: “2”,
“name”: “Sru”,
“email”: “[email protected]”
},
{
“id”: “3”,
“name”: “Manz”,
“email”: “[email protected]”
}
]