pnpm link
Алиасы: ln
Делает текущий локальный пакет доступным для всей системы или в другом расположении.
pnpm link <название или путь к папке>
pnpm link --global
pnpm link --global <название-пакета>
Опции
--dir <название или путь до папки>, -C
- По умолчанию: Текущая рабочая папка
 - Тип: Путь в виде строки
 
Изменяет расположение ссылки на <название или путь до папки>.
pnpm link <название или путь до папки>
Связывает пакет из папки <dir> с node_modules пакета, из которого вы выполняете эту команду или указываете с помощью параметра --dir.
For example, if you are inside
~/projects/fooand you executepnpm link --dir ../bar, thenfoowill be linked tobar/node_modules/foo.
pnpm link --global
Links package from location where this command was executed or specified via --dir option to global node_modules, so it can be referred from another package with pnpm link --global <pkg>. Also if the package has a bin field, then the package's binaries become available system-wide.
pnpm link --global <pkg>
Связывает указанный пакет (<pkg>) из глобальных node_modules с node_modules пакета, из которого эта команда была выполнена или указана с помощью опции --dir.
Difference between pnpm link <dir> and pnpm link --dir <dir>
pnpm link <dir> links the package from <dir> to the node_modules of the package where the command was executed. pnpm link --dir <dir> links the package from the current working directory to <dir>.
# The current directory is foo
pnpm link ../bar
- foo
  - node_modules
    - bar -> ../../bar
- bar
# The current directory is bar
pnpm link --dir ../foo
- foo
  - node_modules
    - bar -> ../../bar
- bar