如何通过“npm ci"跳过安装可选依赖项?

如何通过“npm ci

问题描述:

如何通过 npm cipackage-lock.json 跳过安装可选依赖项?

How I can skip installing optional dependencies from package-lock.json by npm ci?

您可以使用 npm ci --no-optional .如果 npm 仍然安装可选包.然后在删除 package.lock.json 后尝试并再次运行命令.

You can use npm ci --no-optional . If npm still installs the optional package. Then try after removing package.lock.json and run the command again.