DEV Community

Discussion on: Build a NestJS Module for Knex.js (or other resource-based libraries) in 5 Minutes

Collapse
zyles profile image
Zyles

Can you update this article? It seems out of date.

What is in constants.ts ?

And I get error 'knex_1.Knex is not a constructor'

Maybe a working git repo would be nice. Something is missing.

Collapse
koakh profile image
Mário Monteiro

another awesome post from John :)
follow the tutorial and works in current date only fails in bellow fix

import { Config } from 'knex';
Enter fullscreen mode Exit fullscreen mode

with

import { Knex } from 'knex'

export interface NestKnexOptions extends Knex.Config {}
Enter fullscreen mode Exit fullscreen mode

and one must update this dependencies

"devDependencies": {
  "@types/jest": "^26.0.24",
  "typescript": "^4.3.5"
}    
Enter fullscreen mode Exit fullscreen mode

thanks John