English 中文(简体)
在使用npm工作空间时,我如何安装单一包裹的附属设施?
原标题:How do I install dependencies for a single package when using npm workspaces?
问题回答

我将使用install

Using Node v18.16.0 and npm v9.7.2 here is the output of npm install --help (npm >= v9.7.2 is required to correctly omit dev dependencies):

$ npm install --help
Install a package

Usage:
npm install [<package-spec> ...]

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global]
[--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
[--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--include-workspace-root] [--install-links]

aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall

Run "npm help install" for more info

在此情况下,我建议合并处理。

由此可见:

npm install --install-strategy=nested --omit=dev --workspace=server

页: 1

这应当留下一个<代码>node_modules 的目录,该目录仅以server/code>界定的属地为基础。 页: 1 也可在<条码>--omit=peer上删除<条码>。 工作空间。

www.un.org/Depts/DGACM/index_spanish.htm 根据你的附属图表,这仍然可以留下多个<代码>node_modules的名录,这些目录将要求结合制作工艺品,即:-install-strategy=nested。 似乎没有为Npm工作空间做正确的工作。 然而,所安装的舱位应当与<代码>-workspace通过的工作空间相隔。 这里是example repo,显示这些受扶养人如何合并。





相关问题
Trying to install Flowise and npm cannot find it

On the https://flowiseai.com/ website, it says that all I have to do to use flowise is the following: npm install -g flowise npx flowise start However, when I try to do the install, it doesn t work....

Cannot destructure property name of node as it is null

when I want to install dependencies of the aurelia project, got this error: npm ERR! code 1 npm ERR! git dep preparation failed npm ERR! command /Users/ehsanghaffarii/.nvm/versions/node/v15.5.1/bin/...

npm install issues on Ubuntu 9.04

I’m trying to install npm using the commands from here: http://howtonode.org/introduction-to-npm Specifically, when I run: curl http://npmjs.org/install.sh | sh This is the error I get... node cli....

热门标签