tsconfig / bases

Hosts TSConfigs to extend in a TypeScript app, tuned to a particular runtime environment
MIT License
6.34k stars 237 forks source link

error TS6046; "lib" error for node-lts #200

Closed pwmcintyre closed 1 year ago

pwmcintyre commented 1 year ago

hi team

I am suddenly getting build failures since last weeks commit - see below

NodeJS version: 18.15.0

package versions: "@tsconfig/node-lts": "^18.12.2", "typescript": "^4.9.5"

node_modules/@tsconfig/node-lts/tsconfig.json(9,7): error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref'.

seems to be caused by this change: https://github.com/tsconfig/bases/blame/014e8927b7155640f65a7492fb4bb09f5c49f531/bases/node-lts.json#L9

seeking advice

orta commented 1 year ago

From the README

We target the latest versions stable version of TypeScript, note that because we want to be consistent with the versioning the target runtime we can't always do semver releases.

As we tie the LTS major version to the node version, we can't bump it to 19 for any breaking TS changes I'm afraid

pwmcintyre commented 1 year ago

hi 👋

maybe a misunderstanding? i'm not attempting to use node v19, i'm using v18

maybe you can help me fix my issue? the lib as specified by @tsconfig/node-lts is es2023 but something is saying that is not a valid choice ... is this a typescript issue? or a nodejs issue? am i using an incompatible version of something?

seeking advice

orta commented 1 year ago

Upgrade your typescript version to the latest version, or lock to an older version of the nodelts dependency