首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Yarn安装不变冲突:应该有一个已解决的引用

Yarn安装不变冲突:应该有一个已解决的引用
EN

Stack Overflow用户
提问于 2019-06-05 12:13:51
回答 1查看 2.9K关注 0票数 2

我正在尝试在Jenkins 2.150.1上构建一个发行版,但我遇到了一个yarn install错误:Invariant Violation: should have a resolved reference

安装在我的本地机器上运行得很好,配置相同。

有人知道我该怎么解决这个问题吗?

代码语言:javascript
代码运行次数:0
运行
复制
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

相关Dockerfile:

代码语言:javascript
代码运行次数:0
运行
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-06 08:41:53

发现这是由于CI服务器的yarn版本造成的。

已在本地降级到版本1.3.2,并能够复制该问题。

升级到yarn 1.16,这个问题就消失了。

解决方案:升级纱线:

代码语言:javascript
代码运行次数:0
运行
复制
sh "curl --compressed -o- -L https://yarnpkg.com/install.sh | sh"
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56454177

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档