pnpm link
别名: ln
让当前目录下的软件包在系统范围内或其它位置都可访问。
pnpm link <dir>
pnpm link --global
pnpm link --global <pkg>
参数
--dir <dir>, -C
- 默认值:当前工作目录
- 类型:路径(字符串)
将链接的目标位置修改为 <dir>
。
pnpm link <dir>
将 <dir>
目录下的软件包链接到当前目录下的 node_modules 目录下,或者通过 --dir
参数指定的目录下。
For example, if you are inside
~/projects/foo
and you executepnpm link --dir ../bar
, thenfoo
will be linked tobar/node_modules/foo
.