cli-table / cli-table3

Pretty unicode tables for the command line
MIT License
515 stars 44 forks source link

Error [ERR_REQUIRE_ESM]: require() of ES Module #329

Closed hashfi-motion closed 1 year ago

hashfi-motion commented 1 year ago
Error [ERR_REQUIRE_ESM]: require() of ES Module D:..\node_modules\string-width\index.js from D:\...\node_modules\cli-table3\src\utils.js not supported.
Instead change the require of index.js in D:\...\node_modules\cli-table3\src\utils.js to a dynamic import() which is available in all CommonJS modules.

My project is in TypeScript, this is the error I got when I try to run it. Let me know if you need more information.

hashfi-motion commented 1 year ago

Never mind, fixed it. I need to yarn in D:\...\node_modules\cli-table3 first

RobinClowers commented 6 months ago

I'm also seeing this error, and I don't understand the fix you posted, are you saying you had to cd into node_modules\cli-table3 and run yarn install? If so there is something very wrong!

speedytwenty commented 6 months ago

Please see my relevant comment in #330