Documentation


Installing npm packages

If your project depends on npm packages, you can install them in the Virtual Machine before performing an analysis. To do so, edit your project configuration and install the package using the pre_composer_script option:

1
2
3
pre_composer_script: |
    #!/bin/bash
    npm install -g <package-name>

Example: How can I install Sass?

To install Sass, you need to install its npm package but also to configure the PATH so you can use it in your project:

1
2
3
4
5
6
7
8
pre_composer_script: |
    #!/bin/bash

    # install Sass
    npm install -g sass

    # make Sass available on the PATH
    export PATH=/opt/node_modules/bin:$PATH