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

Support for commonjs #14

Closed
amkhapare opened this issue Sep 23, 2021 · 1 comment
Closed

Support for commonjs #14

amkhapare opened this issue Sep 23, 2021 · 1 comment

Comments

@amkhapare
Copy link

Hi,

I currently use version 4.0.0 of os-name and was trying to update os-name 5.0.0 to get the new windows 11 display name and I noticed the below error.

`
../../../node_modules/os-name/index.js:1
({"Object.":function(module,exports,require,__dirname,__filename,global,jest){import os from 'node:os';
^^^^^^

SyntaxError: Cannot use import statement outside a module

  1 | import * as os from 'os';
> 2 | const osName  = require('os-name');

`

The newer version of os-name (5.0.0) has adopted ES modules and my current project setup doesn't support it.

Is there a way to support commonjs modules?

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

2 participants