This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.Npm.
Summary
Installs packages using the specified settings.
- Assembly
- Cake
.Npm .dll - Namespace
- Cake
.Npm - Containing Type
- NpmInstallAliases
Syntax
public static void NpmInstall(this ICakeContext context, NpmInstallSettings settings)
Examples
Install packages in a specific working directory ('npm install')
var settings =
new NpmInstallSettings
{
WorkingDirectory = "c:\myproject"
};
NpmInstall(settings);
Force fetching of remote resources ('npm install --force')
var settings =
new NpmInstallSettings
{
Force = true
};
NpmInstall(settings);
Install gulp globally ('npm install gulp -g')
var settings =
new NpmInstallSettings
{
Global = true
};
settings.AddPackage("gulp");
NpmInstall(settings);
Ignore devDependencies while installaling packages of the project in the current directory ('npm install --production')
var settings =
new NpmInstallSettings
{
Production = true
};
NpmInstall(settings);
Use specific log level ('npm install')
var settings =
new NpmInstallSettings
{
LogLevel = NpmLogLevel.Verbose
};
NpmInstall(settings);
Attributes
Type | Description |
---|---|
Cake |
|
Cake |
Parameters
Name | Type | Description |
---|---|---|
context | ICakeContext | The context. |
settings | NpmInstallSettings | The settings. |
Return Value
Type | Description |
---|---|
void |