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

Compatibility issue with Nodejs 20 #14

Open
geaaru opened this issue Aug 5, 2024 · 0 comments
Open

Compatibility issue with Nodejs 20 #14

geaaru opened this issue Aug 5, 2024 · 0 comments

Comments

@geaaru
Copy link

geaaru commented Aug 5, 2024

Hi, i'm trying to build and install from master branch with Nodejs 20 but I receive this error:

$> npm install 

> [email protected] prepublish
> npm run build


> [email protected] build
> tsc

node_modules/@types/node/index.d.ts:39:1 - error TS1084: Invalid 'reference' directive syntax.

39 /// <reference lib="es2017" />
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


npm error code 2
npm error path /home/geaaru/dev/constantinople
npm error command failed
npm error command sh -c npm run build

npm error A complete log of this run can be found in: /home/geaaru/.npm/_logs/2024-08-05T15_49_07_213Z-debug-0.log

Hereinafter, some data about version used:

$> tsc --version
Version 5.5.4
$>  node --version 
v20.15.0
$> npm --version
10.7.0

Also downgrading to tsc-2.7.1 i have errors.
And I see this if I try to force using tsconfig.json file:

$> tsc -p ./tsconfig.json 
src/index.ts:41:31 - error TS2345: Argument of type 'Expression | PrivateName' is not assignable to parameter of type 'Expression'.
  Type 'PrivateName' is not assignable to type 'Expression'.
    Property 'body' is missing in type 'PrivateName' but required in type 'ClassExpression'.

41       const left = toConstant(expression.left);
                                 ~~~~~~~~~~~~~~~

  node_modules/@babel/types/lib/index.d.ts:1824:5
    1824     body: ClassBody;
             ~~~~
    'body' is declared here.

src/index.ts:43:42 - error TS2345: Argument of type '"+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>"' is not assignable to parameter of type 'Operator'.
  Type '"|>"' is not assignable to type 'Operator'.

43       return constant && binaryOperation(expression.operator, left, right);
                                            ~~~~~~~~~~~~~~~~~~~

src/index.ts:73:24 - error TS2345: Argument of type 'Expression | PrivateName' is not assignable to parameter of type 'Expression'.

73           ? toConstant(expression.callee.property)
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/index.ts:125:22 - error TS2345: Argument of type 'Expression | PrivateName' is not assignable to parameter of type 'Expression'.

125         ? toConstant(expression.property)
                         ~~~~~~~~~~~~~~~~~~~

src/index.ts:153:26 - error TS2345: Argument of type 'Expression | PrivateName' is not assignable to parameter of type 'Expression'.

153             ? toConstant(property.key)
                             ~~~~~~~~~~~~

src/index.ts:205:37 - error TS2345: Argument of type 'Expression | TSType' is not assignable to parameter of type 'Expression'.
  Type 'TSAnyKeyword' is not assignable to type 'Expression'.
    Property 'expression' is missing in type 'TSAnyKeyword' but required in type 'TSNonNullExpression'.

205           result += '' + toConstant(expression.expressions[i]);
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/@babel/types/lib/index.d.ts:2850:5
    2850     expression: Expression;
             ~~~~~~~~~~
    'expression' is declared here.


Found 6 errors in the same file, starting at: src/index.ts:41

Could this be a compatibility problem with Nodejs20?

Thanks in advance for any suggestions.

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

1 participant