Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: argument for lib option invalid for TS 4.9 and below on node18 #174

Open
prescottprue opened this issue Apr 18, 2023 · 6 comments
Open

Comments

@prescottprue
Copy link

prescottprue commented Apr 18, 2023

I'm seeing the following error with the 2.0.0 release when using with tsc and ts-node:

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'.

It appears to be due to the change here where lib was updated to es2023 - was it meant to be the target field?

@philihp
Copy link

philihp commented Apr 19, 2023

yeah, broken over here too. Maybe that works for node 20, but it doesn't work for 18

@orta
Copy link
Member

orta commented Apr 19, 2023

I assume you're talking about the node18 tsconfig base: 2.0 supports TypeScript 5.0+, use 1.x for older versions of typescript

@prescottprue
Copy link
Author

prescottprue commented Apr 19, 2023

@orta That is totally fair and I confirmed on my end - things build after being on Typescript 5. Is there a way that we can document that in the release notes or README or both?

Is there a way that we can mark typescript 5 as a required peer dependency so that others don't bump into this and need to look for docs?

@fasani-tx
Copy link

Same issue here, bumping to TS5 worked.

@orta
Copy link
Member

orta commented May 1, 2023

After npm7 I don't trust peer dependencies with that dependency manager, you don't want to accidentally have two copies of typescript in your deps. I'm open to a table at the bottom of the README showing what are the latest versions for TS 4.9 and below

@orta orta changed the title bug: argument for lib option invalid bug: argument for lib option invalid for TS 4.9 and below on node18 May 2, 2023
@kevinlul
Copy link

kevinlul commented Jun 3, 2023

I ran into this issue as well:

TSError: ⨯ Unable to compile TypeScript:
../../../node_modules/@tsconfig/node16/tsconfig.json:7:15 - error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'.

7     "module": "Node16",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants