0

Situation

Within the company we've got our own NPM registry and the corporate network blocks the access to the public NPM registry.

Problem

To install cypress, we would like the binary to be downloaded from our own NPM registry by running following command:

export CYPRESS_INSTALL_BINARY=<Our NPM registry URL>

However it does not work if we add the above command into the preinstall hook. We believe it's because NPM runs each task in a separate process.

So my question is, how to export an environment variable for npm install to use in package.json?

1 Answer 1

0

Just add a line to the .npmrc file like this:

CYPRESS_INSTALL_BINARY = https://some.registry

Which ends up in Cypress resolving the donwload from the URL specified.

[08:47:39]  Downloading Cypress     [started]
[08:47:39]  Downloading Cypress     [failed]
[08:47:39] → The Cypress App could not be downloaded.

Please check network connectivity and try again:

----------

URL: https://some.registry
Error: unable to reach host

----------
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.