sindresorhus/clipboardy

Error [ERR_REQUIRE_ESM]: require() of ES Module E:\~\node_modules\clipboardy\index.js not supported.

Harshita-mindfire opened this issue ยท 3 comments

I'm working on a typescript project and receiving error from clipboardy

[ERR_REQUIRE_ESM]: require() of ES Module from not supported. 
Instead change the require of index.js in... to a dynamic import() which is available in all CommonJS modules.

my code:

import clipboard from 'clipboardy`
clipboard.writeSync('...');

duplicate

Duplicate of what?

Most likely referring to this