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] Failed to init a new Ts.ED project with @tsed/cli v5.2.1 #392

Closed
1 task
Bugslive opened this issue Jul 24, 2024 · 7 comments · Fixed by #393 or #394
Closed
1 task

[BUG] Failed to init a new Ts.ED project with @tsed/cli v5.2.1 #392

Bugslive opened this issue Jul 24, 2024 · 7 comments · Fixed by #393 or #394
Assignees
Labels
bug Something isn't working released

Comments

@Bugslive
Copy link
Contributor

Bugslive commented Jul 24, 2024

Information

  • @tsed/cli v5.2.1
  • Node.JS v22.4.1 (npm v10.8.1) (also tried with v20.15.1 (npm v10.7.0) and v18.20.4 (npm v10.7.0))

I tried to initialize a new Ts.ED project with the @tsed/cli package and it failed

what I've tried

~/workspace/tmp/queryoptions > npx @tsed/cli init . Need to install the following packages:
@tsed/[email protected]
Ok to proceed? (y) y

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/vincent/.npm/_npx/8fd6f229e097057e/node_modules/update-notifier/index.js from /Users/vincent/.npm/_npx/8fd6f229e097057e/node_modules/@tsed/cli-core/lib/cjs/CliCore.js not supported.
Instead change the require of index.js in /Users/vincent/.npm/_npx/8fd6f229e097057e/node_modules/@tsed/cli-core/lib/cjs/CliCore.js to a dynamic import() which is available in all CommonJS modules.
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at /Users/vincent/.npm/_npx/8fd6f229e097057e/node_modules/@tsed/cli-core/lib/cjs/CliCore.js:61:101
at async Cli.updateNotifier (/Users/vincent/.npm/_npx/8fd6f229e097057e/node_modules/@tsed/cli-core/lib/cjs/CliCore.js:61:45)
at async Cli.bootstrap (/Users/vincent/.npm/_npx/8fd6f229e097057e/node_modules/@tsed/cli/lib/cjs/Cli.js:61:9) {
code: 'ERR_REQUIRE_ESM'
}
~/workspace/tmp/queryoptions > npm install -g @tsed/cli
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.

added 389 packages in 3s

75 packages are looking for funding
run npm fund for details
~/workspace/tmp/queryoptions > tsed init .
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/update-notifier/index.js from /Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js not supported.
Instead change the require of index.js in /Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js to a dynamic import() which is available in all CommonJS modules.
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at /Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js:61:101
at async Cli.updateNotifier (/Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js:61:45)
at async Cli.bootstrap (/Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/lib/cjs/Cli.js:61:9) {
code: 'ERR_REQUIRE_ESM'
}

Acceptance criteria

  • Criteria 1
Copy link

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

1 similar comment
Copy link

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

@Romakita
Copy link
Contributor

🎉 This issue has been resolved in version 5.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Bugslive
Copy link
Contributor Author

Bugslive commented Jul 25, 2024

Hello @Romakita,
I still have the same issue with @tsed/cli v5.5.2 (Node 20 & 22)

> npm ls --depth=0 -global

/Users/vincent/.nvm/versions/node/v20.16.0/lib
├── @tsed/[email protected]
├── [email protected]
└── [email protected]

> tsed init .
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/vincent/.nvm/versions/node/v20.16.0/lib/node_modules/@tsed/cli/node_modules/update-notifier/index.js from /Users/vincent/.nvm/versions/node/v20.16.0/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js not supported.
Instead change the require of index.js in /Users/vincent/.nvm/versions/node/v20.16.0/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js to a dynamic import() which is available in all CommonJS modules.
at /Users/vincent/.nvm/versions/node/v20.16.0/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js:61:101
at async Cli.updateNotifier (/Users/vincent/.nvm/versions/node/v20.16.0/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js:61:45)
at async Cli.bootstrap (/Users/vincent/.nvm/versions/node/v20.16.0/lib/node_modules/@tsed/cli/lib/cjs/Cli.js:61:9) {
code: 'ERR_REQUIRE_ESM'
}

> nvm use 22
Now using node v22.4.1 (npm v10.8.2)

> npm ls --depth=0 -global

/Users/vincent/.nvm/versions/node/v22.4.1/lib
├── @tsed/[email protected]
├── [email protected]
└── [email protected]

> tsed init .

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/update-notifier/index.js from /Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js not supported.
Instead change the require of index.js in /Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js to a dynamic import() which is available in all CommonJS modules.
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at /Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js:61:101
at async Cli.updateNotifier (/Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/node_modules/@tsed/cli-core/lib/cjs/CliCore.js:61:45)
at async Cli.bootstrap (/Users/vincent/.nvm/versions/node/v22.4.1/lib/node_modules/@tsed/cli/lib/cjs/Cli.js:61:9) {
code: 'ERR_REQUIRE_ESM'
}`

@Romakita
Copy link
Contributor

🎉 This issue has been resolved in version 5.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Romakita
Copy link
Contributor

Yes i forgot to fix the tsconfig of @tsed/cli-core also.
The latest fix is released now

@Bugslive
Copy link
Contributor Author

Thank you @Romakita.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
Status: Done
2 participants