ai-devkit icon indicating copy to clipboard operation
ai-devkit copied to clipboard

Issue on node 20.12.2

Open codeaholicguy opened this issue 9 months ago • 4 comments

Run: npx [email protected] skill add codeaholicguy/ai-devkit capture-knowledge

Error:

npm WARN deprecated [email protected]: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
/Users/hoangnguyen/.npm/_npx/0d28a7f308c6af99/node_modules/ai-devkit/dist/util/terminal-ui.js:8
const ora_1 = __importDefault(require("ora"));
                              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/hoangnguyen/.npm/_npx/0d28a7f308c6af99/node_modules/ora/index.js from /Users/hoangnguyen/.npm/_npx/0d28a7f308c6af99/node_modules/ai-devkit/dist/util/terminal-ui.js not supported.
Instead change the require of index.js in /Users/hoangnguyen/.npm/_npx/0d28a7f308c6af99/node_modules/ai-devkit/dist/util/terminal-ui.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/hoangnguyen/.npm/_npx/0d28a7f308c6af99/node_modules/ai-devkit/dist/util/terminal-ui.js:8:31) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.12.2

codeaholicguy avatar Feb 26 '26 05:02 codeaholicguy

Hi @codeaholicguy, I just created a new PR to fix this issue. Please help me to check it ! Thanks for your efforts on this project. This is my PR: #30

kietnguyenvulcanlabs avatar Mar 05 '26 07:03 kietnguyenvulcanlabs

^20.19.0 || ^22.12.0 || >=24.0.0 should work fine, ERR_REQUIRE_ESM is shipped, those are a year old I suggest just updating engines instead of downgrading deps / breaking semver

ChALkeR avatar Mar 05 '26 12:03 ChALkeR

@kietnguyenvulcanlabs similar to @ChALkeR suggestion, for this issue, I recommend specifying the minimum supported version using engines rather than downgrading. Thank you.

codeaholicguy avatar Mar 06 '26 01:03 codeaholicguy

I updated the minimum engine requirement, will close this.

codeaholicguy avatar Mar 18 '26 10:03 codeaholicguy