Search code examples
gitlabcontinuous-integrationyarnpkg

Yarn doesn't find packages


I try to build assets from my SymFony project in GitLab CI/CD but I have a problem with the Yarn step (installation process).

This is the logs from GitLab:

$ rm yarn.lock
$ yarn --version
1.22.5
$ yarn config set cache-folder .yarn
yarn config v1.22.5
success Set "cache-folder" to ".yarn".
Done in 0.03s.
$ yarn config set proxy-http http://<username>:<password>@<url>:<port>
yarn config v1.22.5
success Set "proxy-http" to "http://<username>:<password>@<url>:<port>".
Done in 0.04s.
$ yarn config set proxy-https-proxy http://<username>:<password>@<url>:<port>
yarn config v1.22.5
success Set "proxy-https-proxy" to "http://<username>:<password>@<url>:<port>".
Done in 0.04s.
$ yarn install --network-timeout=1000000
yarn install v1.22.5
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info If you think this is a bug, please open a bug report with the information provide in "/builds/eirel/eirel-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error An unexpected error occurred: "https://registry.yarnpkg.com/@fortawesome%2ffontawesome-free: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".

At work, I have a proxy but it is correctly configurated in ci file configuration.


Solution

  • The problem is with proxy configuration instruction in CI configuration file.

    I have been write:

    • proxy-http
    • proxy-https

    But, the good instruction is:

    • proxy for http_proxy
    • https-proxy for https_proxy