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

Error ERR_REQUIRE_ESM #14

Closed
1Map opened this issue May 27, 2021 · 2 comments
Closed

Error ERR_REQUIRE_ESM #14

1Map opened this issue May 27, 2021 · 2 comments

Comments

@1Map
Copy link

1Map commented May 27, 2021

I get the following error:

Uncaught Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\MyApp\node_modules\temp-write\index.js

I Use Latest NodeJS: 16.2.0
I Use Latest temp-write: 5.0.0

@sindresorhus
Copy link
Owner

@1Map
Copy link
Author

1Map commented May 27, 2021

The problem is:
I had it like:

tmpWrite = require('temp-write')

and changed it to:

import tmpWrite from 'temp-write'

It then gives this error:

'import ... =' can only be used in TypeScript files.ts(8002)

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