<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated>2026-10-16T11:19:19Z</updated>
  <generator>https://njump.me</generator>

  <title>Nostr notes by Andrew Shitov (Unofficial)</title>
  <author>
    <name>Andrew Shitov (Unofficial)</name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://njump.me/npub1tkg9yr7cw77xa95qdyj6cem4cdwa3lycpxep3sqnama2ve5c9tmqft2dky.rss" />
  <link href="https://njump.me/npub1tkg9yr7cw77xa95qdyj6cem4cdwa3lycpxep3sqnama2ve5c9tmqft2dky" />
  <id>https://njump.me/npub1tkg9yr7cw77xa95qdyj6cem4cdwa3lycpxep3sqnama2ve5c9tmqft2dky</id>
  <icon>https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f58b.png</icon>
  <logo>https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f58b.png</logo>




  <entry>
    <id>https://njump.me/nevent1qqsds9m2l59lyujspx7vyttekde9693gwgpuvvj9xyndvtn0f30nqsgzypweq5s0mpmmcm5ksp5jttr8whp4mk8unqymyxxqz0h04fnxnq40vsygreg</id>
    
      <title type="html">Better ways to install modules in Raku&#43;&#43; Raku&#43;&#43; comes with its ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsds9m2l59lyujspx7vyttekde9693gwgpuvvj9xyndvtn0f30nqsgzypweq5s0mpmmcm5ksp5jttr8whp4mk8unqymyxxqz0h04fnxnq40vsygreg" />
    <content type="html">
      Better ways to install modules in Raku&#43;&#43;&lt;br/&gt;&lt;br/&gt;Raku&#43;&#43; comes with its own module manager. It uses a module store compatible with zef, but recent versions offer more convenient ways to install modules in bulk.&lt;br/&gt;TL;DR:&lt;br/&gt;Install all the dependencies used by the program:&lt;br/&gt;$ raku install program.raku&lt;br/&gt;Recursively install all the modules found in the directory:&lt;br/&gt;$ raku install -r dist/lib&lt;br/&gt;(Note that the raku command here and below is a symlink to rakupp.)&lt;br/&gt;In detail&lt;br/&gt;To test the new methods, you can choose to use a program specially added to the repository: examples/dirstat/dirstat.raku.&lt;br/&gt;This program needs four modules from the Raku ecosystem and two its own modules located in the lib directory next to the program itself:&lt;br/&gt;use lib &amp;#39;lib&amp;#39;;&lt;br/&gt;use DirStat::Scan;&lt;br/&gt;use DirStat::Tally;&lt;br/&gt;use JSON::Native;&lt;br/&gt;use Number::Bytes::Human :functions;&lt;br/&gt;use Terminal::ANSIColor;&lt;br/&gt;use Terminal::Boxer;&lt;br/&gt;For the purpose of the experiment, you can first uninstall some of the modules if they are already installed locally, for example:&lt;br/&gt;$ raku uninstall Terminal::ANSIColor;&lt;br/&gt;Now, instead of manually installing modules one after another with raku install, you can install all the dependencies in a single go:&lt;br/&gt;$ raku install examples/dirstat/dirstat.raku&lt;br/&gt;This command will install all the ecosystem modules that the program requires, including their dependencies:&lt;br/&gt;$ raku install examples/dirstat/dirstat.raku&lt;br/&gt;examples/dirstat/dirstat.raku: a program — installing the 4 modules it uses, not the program&lt;br/&gt;2 of the modules found by reading the source are installed already&lt;br/&gt;plan (2 distributions, dependencies first):&lt;br/&gt;Number::Bytes::Human:ver&amp;lt;0.0.4&amp;gt;:auth&amp;lt;zef:raku-community-modules&amp;gt; &lt;a href=&#34;https://360.zef.pm/N/UM/NUMBER_BYTES_HUMAN/143aa3e9d5a629e2fcd5b68e7b0e240acfedf577.tar.gz&#34;&gt;https://360.zef.pm/N/UM/NUMBER_BYTES_HUMAN/143aa3e9d5a629e2fcd5b68e7b0e240acfedf577.tar.gz&lt;/a&gt;&lt;br/&gt;. . .&lt;br/&gt;testing Terminal::Boxer: 1 file&lt;br/&gt;installed Terminal::Boxer:ver&amp;lt;0.3.1&amp;gt;:auth&amp;lt;zef:thundergnat&amp;gt;&lt;br/&gt;done: 2 distributions processed into /Users/ash/.raku&lt;br/&gt;From this output you can see that two of the four dependencies were already installed on my computer.&lt;br/&gt;But you cannot yet run our test program by just providing its name:&lt;br/&gt;$ raku examples/dirstat/dirstat.raku&lt;br/&gt;Could not find DirStat::Scan in:&lt;br/&gt;lib&lt;br/&gt;lib&lt;br/&gt;rakulib&lt;br/&gt;/Users/ash/.raku&lt;br/&gt;/opt/homebrew/Cellar/rakudo/2026.09/share/perl6/site&lt;br/&gt;/opt/homebrew/Cellar/rakudo/2026.09/share/perl6/vendor&lt;br/&gt;(X::CompUnit::UnsatisfiedDependency)&lt;br/&gt;in block &amp;lt;unit&amp;gt; at examples/dirstat/dirstat.raku line 8&lt;br/&gt;8 | use DirStat::Scan;&lt;br/&gt;The program uses the modules, which are not available in the Raku ecosystem. So, one of the possible solutions is to pass the location to them:&lt;br/&gt;$ raku -I examples/dirstat examples/dirstat/dirstat.raku&lt;br/&gt;. — 569M in 83 kinds of file&lt;br/&gt;. . .&lt;br/&gt;…and 80 more; --top=83 shows them all&lt;br/&gt;The program prints a table of file statistics by type and size in the current directory. I’ve deliberately omitted the output here.&lt;br/&gt;The second method is to install the program’s own modules to your local module store. Again, instead of manually looping over them, install them recursively from their location:&lt;br/&gt;$ raku install -r examples/dirstat&lt;br/&gt;examples/dirstat: no META6.json above it — installing 2 modules as DirStat:ver&amp;lt;0&amp;gt;: DirStat::Scan, DirStat::Tally&lt;br/&gt;plan (1 distribution, dependencies first):&lt;br/&gt;DirStat:ver&amp;lt;0&amp;gt;:auth&amp;lt;&amp;gt; /Users/ash/raku&#43;&#43;/examples/dirstat&lt;br/&gt;installing DirStat:ver&amp;lt;0&amp;gt;:auth&amp;lt;&amp;gt; from /Users/ash/raku&#43;&#43;/examples/dirstat&lt;br/&gt;installed DirStat:ver&amp;lt;0&amp;gt;:auth&amp;lt;&amp;gt;&lt;br/&gt;done: 1 distribution processed into /Users/ash/.raku&lt;br/&gt;(In this example there are no nested directories, but that does not change the command: raku install -r &amp;lt;dir&amp;gt;.)&lt;br/&gt;All the modules are now installed and Raku&#43;&#43; can find them, so just run the program:&lt;br/&gt;$ raku examples/dirstat/dirstat.raku&lt;br/&gt;P. S. With the modules installed, the program also runs unchanged under Rakudo:&lt;br/&gt;$ rakudo examples/dirstat/dirstat.raku&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://andrewshitov.com/2026/10/10/better-ways-to-install-modules-in-raku/&#34;&gt;https://andrewshitov.com/2026/10/10/better-ways-to-install-modules-in-raku/&lt;/a&gt;
    </content>
    <updated>2026-10-16T02:51:43Z</updated>
  </entry>

</feed>