Установка пряжи Invariant Violation: должна иметь разрешенную ссылку - PullRequest
2 голосов
/ 05 июня 2019

Я пытаюсь создать релиз на Jenkins 2.150.1, и я сталкиваюсь с ошибкой при установке пряжи: Invariant Violation: should have a resolved reference

Установка отлично работает на моем локальном компьютере с такой же конфигурацией.

Кто-нибудь знает, как я могу решить эту проблему?

verbose 0.446 Checking for configuration file "/usr/.yarnrc".

verbose 0.45 current time: 2019-06-05T03:51:11.266Z

[1/4] Resolving packages...

verbose 1.179 Performing "GET" request to
"https://registry.yarnpkg.com/ember-cli-babel".

verbose 1.286 Request "https://registry.yarnpkg.com/ember-cli-babel"
finished with status code 200.

warning Resolution field "ember-cli-babel@6.12.0" is incompatible with
requested version "ember-cli-babel@^5.1.6"

warning Resolution field "ember-cli-babel@6.12.0" is incompatible with
requested version "ember-cli-babel@^5.1.6"

warning Resolution field "ember-cli-babel@6.12.0" is incompatible with
requested version "ember-cli-babel@^5.1.6"

warning Resolution field "ember-cli-babel@6.12.0" is incompatible with
requested version "ember-cli-babel@^5.1.6"

verbose 1.435 Invariant Violation: should have a resolved reference

  at invariant (/opt/yarn/lib/cli.js:1296:15)

  at PackageRequest.resolveToExistingVersion (/opt/yarn/lib/cli.js:34819:51)

  at PackageResolver.resolvePackagesWithExistingVersions (/opt/yarn/lib/cli.js:60937:11)

  at /opt/yarn/lib/cli.js:60869:14

  at Generator.next (<anonymous>)

  at step (/opt/yarn/lib/cli.js:92:30)

  at /opt/yarn/lib/cli.js:103:13

  at <anonymous>

  at process._tickCallback (internal/process/next_tick.js:188:7)

error An unexpected error occurred: "should have a resolved
reference".

info If you think this is a bug, please open a bug report with the
information provided in "/usr/src/app/yarn-error.log".

info Visit https://yarnpkg.com/en/docs/cli/install for documentation
about this command.

time="2019-06-05T03:51:12Z" level=fatal msg="build failed: building
[myapp-client]: build artifact: running build: The command '/bin/sh
c yarn --ignore-engines install --verbose' returned a non-zero code: 1"

script returned exit code 1

Соответствующий файл Docker:

FROM node:8.9.4-stretch as builder

WORKDIR /usr/src/app

COPY package.json .
COPY .npmrc .
COPY yarn.lock .
COPY .bowerrc .
COPY bower.json .
RUN yarn cache clean
RUN yarn --ignore-engines install --verbose

COPY . .
RUN yarn run build:production

1 Ответ

1 голос
/ 06 июня 2019

Обнаружено, что это произошло из-за версии пряжи сервера CI.

Локально понижено до версии 1.3.2 и удалось воспроизвести проблему.

Обновлено до пряжи 1.16, и проблема исчезла.

Решение: обновить пряжу:

sh "curl --compressed -o- -L https://yarnpkg.com/install.sh | sh"
...