mrking2you
mrking2you
DDeno
Created by mrking2you on 9/5/2023 in #help
Unable to find local file with installed deno module
I am working on porting the 'octoherd/cli' to Deno. One of the things it does is load a script module to execute. octoherd run -S script.js [...args] While working locally, the cli can find script.js , and everything works as expected. When I run deno install or compile, and try to run the CLI, I get the following error
deno run https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js run -S examples/script.ts
or
deno compile -A https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js
./octoherd run -S examples/script.js
or
deno install -A https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js
../.deno/bin/octoherd run -S examples/script.js
deno run https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js run -S examples/script.ts
or
deno compile -A https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js
./octoherd run -S examples/script.js
or
deno install -A https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js
../.deno/bin/octoherd run -S examples/script.js
✅ Granted all read access. { path: "/Users/.../octoherd-cli-deno/examples/script.ts" } ✅ Granted all net access. error: Uncaught (in promise) Error: [octoherd] /Users/.../octoherd-cli-deno/examples/script.ts does not exist throw new Error([octoherd] ${path} does not exist); ---- I can 100% confirm the file exists. Here is what works in local development
deno run -A octoherd.js run -S examples/script.js'
deno run -A octoherd.js run -S examples/script.js'
7 replies
DDeno
Created by mrking2you on 8/30/2023 in #help
I need more help understanding imports and relative paths for a module I am writing
I am diving into the world of Deno and I am trying to port an existing node CLI. If you are developing a library, you should instead prefer to use the deps.ts pattern discussed in Managing Dependencies. I have read much of the documentation. but still feel lost on what's required/best practice/quality of life. Maybe I have a lack of understanding elsewhere, but I have a hard time understanding if deps.ts is required for end users when running deno install myModule. The different articles jumping around from using deps.ts, imports in deno.json, to import maps has been overwhelming. I can run the CLI locally on my machine, but when I try to install from deno.land/x, I get many errors like error: Relative import path "enquirer" not prefixed with / or ./ or ../ error: Relative import path "chalk" not prefixed with / or ./ or ../ etc.
34 replies