代码之家  ›  专栏  ›  技术社区  ›  Stav Alfi

如何在(as)对等依赖项下安装软件包?

  •  0
  • Stav Alfi  · 技术社区  · 6 年前

    我正在构建一个库,并试图了解如何在peerDependencies下安装/指定依赖项。

    The npm docs don't talk about this under the command npm install :

    npm install (with no args, in package dir)
    npm install [<@scope>/]<name>
    npm install [<@scope>/]<name>@<tag>
    npm install [<@scope>/]<name>@<version>
    npm install [<@scope>/]<name>@<version range>
    npm install <git-host>:<git-user>/<repo-name>
    npm install <git repo url>
    npm install <tarball file>
    npm install <tarball url>
    npm install <folder>
    
    alias: npm i
    common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
    

    1 回复  |  直到 6 年前
        1
  •  4
  •   Connor    6 年前

    据我所知,没有安装对等依赖项的命令行快捷方式。一些谷歌搜索发现 this old issue 其中npm人员简要讨论了添加该功能,但似乎到年还没有实现 npm@6 .

    这不太理想,但我认为手动编辑 package.json this 2013 blog post from the Node.js team

    : ...