i'm trying to use top level awaits, i changed tsconfig.json and package.json to how the ts error said but it keeps giving me the same error
error: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'
tsconfig.json
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Language and Environment */
"target": "ES2022",
/* Modules */
"module": "ES2022",
/* Interop Constraints */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
/* Completeness */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}
package.json
{
"type": "module",
"scripts": {
"dev": "nodemon src/index.ts"
},
"dependencies": {
...
},
"devDependencies": {
...
},
"overrides": {
"semver": "7.5.2"
}
}
ts file error
Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
and all of this also causes an error when importing redis
Cannot find module 'redis'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?