DenoDDeno
Powered by
kurrrrrtK
Denoβ€’3y agoβ€’
33 replies
kurrrrrt

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
deps.ts
is required for end users when running
deno install myModule
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.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Uploaded a module, need help!
TomasZTTomasZ / help
3y ago
LSP badly resolves relative imports between cached modules
AdamgregAAdamgreg / help
3y ago