I'm actually hitting a similar problem right now just trying to build dev branch on Mac for iOS debugging.

error: Error: Unable to resolve module @joplin/fork-uslug from /Users/l/joplin/packages/renderer/MdToHtml.js: @joplin/fork-uslug could not be found within the project or in these directories:
  ../renderer/node_modules
  ../../node_modules
  /Users/l/joplin/packages/app-mobile/node_modules/@joplin/fork-uslug

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
  34 |     source_map: require('./MdToHtml/rules/source_map').default,
  35 | };
> 36 | const uslug = require('@joplin/fork-uslug');
     |                        ^
  37 | const markdownItAnchor = require('markdown-it-anchor');
  38 | // The keys must match the corresponding entry in Setting.js
  39 | const plugins = {

For my app-mobile/node_modules/[at]joplin dir uslug isn't there:

node_modules % cd [at]joplin 
l@lees-mbp @joplin % ls -lha
total 0
drwxr-xr-x    11 l  staff   352B Jan  9 17:45 .
drwxr-xr-x  1033 l  staff    32K Jan  9 18:38 ..
lrwxr-xr-x     1 l  staff     5B Jan  9 17:45 app-mobile -> ../..
lrwxr-xr-x     1 l  staff    25B Jan  9 17:44 fork-htmlparser2 -> ../../../fork-htmlparser2
lrwxr-xr-x     1 l  staff    17B Jan  9 17:44 fork-sax -> ../../../fork-sax
lrwxr-xr-x     1 l  staff    17B Jan  9 17:44 htmlpack -> ../../../htmlpack
drwxr-xr-x   259 l  staff   8.1K Jan  9 17:45 lib
drwxr-xr-x    48 l  staff   1.5K Jan  9 17:45 renderer
drwxr-xr-x    83 l staff   2.6K Jan  9 17:45 tools
lrwxr-xr-x     1 l  staff    17B Jan  9 17:44 turndown -> ../../../turndown
lrwxr-xr-x     1 l  staff    28B Jan  9 17:44 turndown-plugin-gfm -> ../../../turndown-plugin-gfm

I looked at app-desktop/node_modules and I don't see it there either, but the desktop app builds for me now. :thinking:

as a node/node packaging newb I assume there is magic here to build this type of package? (gonna go do some reading now)