NpmInstallAliases.

NpmInstall(ICakeContext, Action<NpmInstallSettings>) Method

Summary

Installs packages using the settings returned by a configurator.
Assembly
Cake.Npm.dll
Namespace
Cake.Npm
Containing Type
NpmInstallAliases

Syntax

public static void NpmInstall(this ICakeContext context, Action<NpmInstallSettings> configurator)

Examples

Install packages in a specific working directory ('npm install')

NpmInstall(settings => settings.FromPath(@"c:\myproject"));

Force fetching of remote resources ('npm install --force')

NpmInstall(settings => setting.WithForce());

Install gulp globally ('npm install gulp -g')

NpmInstall(settings => settings.AddPackage("gulp").InstallGlobally());

Ignore devDependencies while installaling packages of the project in the current directory ('npm install --production')

NpmInstall(settings => setting.OnProduction());

Use specific log level ('npm install')

NpmInstall(settings => settings.WithLogLevel(NpmLogLevel.Verbose));

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

Name Type Description
context ICakeContext The context.
configurator Action<NpmInstallSettings> The settings configurator.

Return Value

Type Description
void