Search code examples
node.jsnestjstypeorm

issue with typeorm modules (Module '"typeorm"' has no exported member 'DataSourceOptions')


I'm getting an error, when launching the project, using docker-compose-up

error

I have packages in package.json:

"@nestjs/typeorm": "^8.0.2", "typeorm": "^0.2.22"

I tried to set up "typeorm": "^0.2.45" and got the same error.


Solution

  • DataSource and DataSourceOptions are added in version ^0.3.0. more.

    You need to update the typeorm's version to 0.3.x, or you can use Connection and ConnectionOptions instead.

    Connection, ConnectionOptions are deprecated, new names to use are: DataSource and DataSourceOptions