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
Failed init cli on NPM #811
Comments
Hi @schlichtanders thanks for reporting this issue. Reejs had removed support for Deno polyfill a few versions ago, due to unintended side affects. I currently tried that and then the deno polyfills loads up, but fails with the following error: INFO Saving important data...
ReferenceError: __dirname is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/data/data/com.termux/files/usr/lib/node_modules/reejs/.reejs/cache/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:13666
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):110:3076
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):110:4066
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):110:59466
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):110:68331
at https://esm.sh/v135/@deno/shim-deno@0.16.0/node/shim-deno.mjs|Node/v18.16.1 (reejs/0.17.0):109:458 I'll be debugging more of it later. |
Here's my personal notice that explains this new error, I've already encountered it before: From my end/Reejs' end - it tries to polyfill __dirname at the start of each file where necessary. However I either disabled that support 2 months ago (that's when I last updated reejs) or reejs failed to polyfill |
I don't want to use |
In case the cli cannot be installed on |
Esm.sh's original service is to serve url imports, and is not a cli focused tool. The cli you see on deno & reejs - esm.sh only manages the importmaps file, but the underlying URL imports work is done by deno & reejs themselves. You might want to look at jspm if you have problems running either of these two. |
My research already pointed me to jspm (took some time to find it). Thank you for the pointer, it really solves the cli part for import maps and also supports esm.sh |
Failed init
I cannot initialize esm.sh with cli on npm
Error message
After running the code in
npx reejs x https://esm.sh init
in an already npm initialized repo I got this:After running
reejs x https://esm.sh init
in a new empty folder, I got thisAdditional info
reejs doctor
report:The text was updated successfully, but these errors were encountered: