跳至主要內容
版本:下一個

pnpm link

命令別名:ln

使目前的區域套件可從整個系統或其他位置存取。

pnpm link <dir>
pnpm link --global
pnpm link --global <pkg>

參數

--dir <dir>, -C

  • 預設值:目前的工作目錄
  • 類型:路徑字串

Changes the link location to <dir>.

Links package from <dir> folder to node_modules of package from where you're executing this command or specified via --dir option.

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>.

Links the specified package (<pkg>) from global node_modules to the node_modules of package from where this command was executed or specified via --dir option.