i get error for import typeOrm

anyone know why my typeorm package is deprecated?

i get error for import typeOrm

anyone know why my typeorm package is deprecated?

What is your current typeorm version? Because there are several deprecations on typeorm@0.3.0
Here is the change logs file for that
https://github.com/typeorm/typeorm/blob/master/CHANGELOG.md
getConnection() is deprecated. To have a globally accessible connection, simply export your data source and use it in places you need it:
export const myDataSource = new DataSource({ /*...*/ })
// now you can use myDataSource anywhere in your application
Connection, ConnectionOptions are deprecated, new names to use are: DataSource and DataSourceOptions. To create the same connection you had before use a new syntax: new DataSource({ /*...*/ }).
createConnection(), createConnections() are deprecated, since Connection is called DataSource now, to create a connection and connect to the database simply do:
server.ts
export const appDataSource = new DataSource({
// ... options
});
appDataSource.initialize();
user.resolver.ts
import { appDataSource } from '../../server';
import { User } from '../user/user.entity';
export class UserResolver {
userRepo = appDataSource.getRepository(User);
}
changelog: https://github.com/typeorm/typeorm/blob/master/CHANGELOG.md
it may be that GetConnect is lagged, clicking on the import may suggest which one to replace, or you need to install the library you intend to use.
Try to reinstall package:
Can you show more details?
instead of using getRepository use this way:
dataSource.getRepository(Entity)