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

ExperimentalWarning while use node 20+ #11

Open
tianyingchun opened this issue Jul 16, 2024 · 4 comments
Open

ExperimentalWarning while use node 20+ #11

tianyingchun opened this issue Jul 16, 2024 · 4 comments

Comments

@tianyingchun
Copy link

(node:60053) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)

node : v20.12.2

@tianyingchun
Copy link
Author

can we change .json to .ts exports?

@millette
Copy link

Instead of import json, should we prefer load-json-file instead?

defaude added a commit to rio-cloud/create-frontend that referenced this issue Jul 23, 2024
When using Node 20, there might be an error popping up regarding importing JSON. See sindresorhus/cli-boxes#11
matz3 added a commit to SAP/ui5-cli that referenced this issue Jul 31, 2024
This came via the in-range update of the `update-notifier` package from
v7.1.0 to v7.2.0.
Root cause: sindresorhus/cli-boxes#11
matz3 added a commit to SAP/ui5-cli that referenced this issue Jul 31, 2024
This came via the in-range update of the `update-notifier` package from
v7.1.0 to v7.2.0.
Root cause: sindresorhus/cli-boxes#11
@fregante
Copy link
Contributor

fregante commented Aug 5, 2024

Anyone reaching this issue via update-notifier can just remove it and reinstall it to fix it. The dependency was downgraded in boxen:

@fregante
Copy link
Contributor

As of Node 22.9.0, this is still experimental: https://nodejs.org/api/esm.html#json-modules

Choices for users who want to avoid the warning:

  • do not use the latest version of cli-boxes
  • set the NODE_NO_WARNINGS=1 env variable

Choices for Sindre:

  • load JSON via fs
  • republish v3 as v5
  • wait it out

Since all reports/pingbacks so far are related to update-notifier (which no longer uses the latest version of cli-boxes) it might be easier to wait it out (a year?)

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

3 participants