Defined Type: npm::install

Defined in:
puppet/modules/npm/manifests/install.pp

Overview

Define: npm::install

Custom resource for installing node.js module dependencies

Parameters

directory

Name of the directory where to execute the install command

Parameters:

  • directory (Any)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'puppet/modules/npm/manifests/install.pp', line 10

define npm::install(
    $directory,
) {
    require ::npm

    exec { "${title}_npm_install":
        command     => '/usr/bin/npm install --no-bin-links',
        cwd         => $directory,
        user        => 'vagrant',
        environment => [
            "NPM_CONFIG_CACHE=${::npm::cache_dir}",
            'NPM_CONFIG_GLOBAL=false',
            'LINK=g++',
            'HOME=/home/vagrant',
        ],
        creates     => "${directory}/node_modules",
        logoutput   => true,
    }
}