Specify NPM dependencies

Learn how to run your tests that need third-party or private npm packages.

You can use the following keys in the run_settings option to specify the npm packages and any options that the packages might need in order for your tests to run successfully.

Note: You’ll need CLI v1.3.0 or later to use package_config_options key.
key value
npm_dependencies A hash of npm packages that are required to run your Cypress tests along with their version numbers.
package_config_options A hash of package options that are required to run your Cypress tests with the packages specified.
Note: If your dependencies include privately or internally hosted NPM packages, you can resolve them by simply adding an .npmrc file as a part of your project, with authentication if required. You can read more about npmrc files and how to set them up here. If you have an authentication layer set up, you can learn how to configure that in the npmrc here. The given location will need to be accessible by our servers - please contact us if you’re facing trouble with privately hosted packages.

For Example:

browserstack.json
{
  "run_settings": {
    ...
    "npm_dependencies": {
      "npm-package-you-need-to-run-tests-1": "^1.2.1",
      "npm-package-you-need-to-run-tests-2": "^7.1.6-beta.13",
    },
    "package_config_options": {
      "npm-package-you-need-to-run-tests-1_options": {
        "option1": true,
        "option2": "some-value"
      }
    }
  }
}

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert