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

Using cli-spinners causes node ExperimentalWarning on console #77

Open
TomFreudenberg opened this issue Jan 13, 2025 · 0 comments
Open

Comments

@TomFreudenberg
Copy link

In case of using import to load the JSON spinner file at:

https://github.com/sindresorhus/cli-spinners/blob/main/index.js#L1

image

you will get a message warning from node like:

(node:74887) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time

When writing CLIs with cli-spinners, this is a bad situation - also - just to simply deactivate node warnings is not a right option.

There is a nodejs issue and discussion about that at: nodejs/node#51347

Also they have shown some "solution" but I am not sure if this will fit here or break too much compatibilty?

nodejs/node#51347 (comment)

import { createRequire } from "module";
const PJSON = createRequire(import.meta.url)("./package.json");
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