patwasalinguistP
Deno14mo ago
3 replies
patwasalinguist

Current way to install -g a tool with deno add?

Hi all,

Not sure if I missed this somewhere in the docs, but perhaps someone else has the same problem, so I’ll ask: suppose I have a script that uses something from @std, let’s say, {resolve} from @std/path.

If I want to install a script do-thing.js and it contains import {resolve} from "@std/path" (this is after running $ deno add jsr:@std/path), do I have to do anything to install that as a utility?

$ deno install -g do-thing.js


runs without complaint, and the script ends up in the path as expected, but when I try to use it I get the error:

error: Relative import path "@std/fs" not prefixed with / or ./ or ../
hint: If you want to use a JSR or npm package, try running deno add jsr:@std/fs or deno add npm:@std/fs
at file:///Users/me/do-thing.js:3:26


But as mentioned above, I already had done deno add @std/path.

Any suggestions? TIA.
Was this page helpful?