ljlm0402 / typescript-express-starter

📘 Quick and Easy TypeScript Express Starter
http://npm.im/typescript-express-starter
MIT License
2.68k stars 411 forks source link

Cannot launch express-typescript-mongoose project on my local #220

Closed healer-1205 closed 1 year ago

healer-1205 commented 1 year ago

"npm start" command doesn't work

Version to Reproduce

My current node version is 16.20.1

Steps to Reproduce

When installing the module is done, I run the npm start command, but this error happened. image

I tried to install @databases npm to fix this but this error happened.

image

kashif-ghafoor commented 1 year ago

Hi @healer-1205, I am facing the same issue. did you find any solution?

healer-1205 commented 1 year ago

Hi @kashif-ghafoor Sorry, I don't find a solution. Instead, I used my one.

Elozzy commented 1 year ago

Hello @kashif-ghafoor @healer-1205 I found a solution for it. Just import the dbConnection path like this import { dbConnection } from './database/index';

then add this to the app.ts await connect(dbConnection.url, dbConnection.options as ConnectOptions);

let me know if it works for you too

ljlm0402 commented 1 year ago

@healer-1205

The fix has been completed and the issue has been closed.