Yarn build failure: old version finding incompatible packages

nodejs
yarn

#1

Im getting the following failure on circle CI (yarn dependency step) that I am not getting locally:

yarn install v0.21.3
[1/4] Resolving packages...
⠁ success Nothing to install.
success Saved lockfile.
$ cd client && yarn install
yarn install v0.21.3
[1/4] Resolving packages...
⠁ [2/4] Fetching packages...
error webpack@2.4.1: The engine "node" is incompatible with this module. Expected version ">=4.3.0 <5.0.0 || >=5.10".
error Found incompatible module

I followed Circle CI’s guidance on using yarn and have exactly what was prescribed in my circle.yml file. The version of Yarn circle CI is using is 0.21.3, which is from two months ago. I ran this locally on 0.23.2 and 0.22.0 without error. It’s possible this is the cause of the error, but I’m unclear how I can update yarn on circle CI (if that’s even possible).

This issue looks similar to the following issue posted on Yarn’s github. However, Yarn’s maintainers don’t want a bug filed if it’s not about the current version. This is understandable given that I’m not able to replicate this issue locally on the current version of Yarn. This makes me think updating yarn on Circle CI is the only path forward to getting a green build.

Any guidance would be greatly appreciated. Thanks in advance!!

Peter


#2

Can you try this method of upgrading yarn:

dependencies:
  pre:
    - rm -rf ~/.yarn
    - npm install -g yarn
    - yarn -v

As seen here: https://circleci.com/gh/levlaz/circleci-testing/123#config/containers/0

Let me know if that resolves your immediate issue and we will work on upgrading yarn in our next image release.


#3

Hi @levlaz, thanks for the response! Here is what I now have in my circly.yml file:

 machine:
  environment:
    PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"

dependencies:
  pre:
    - rm -rf ~/.yarn
    - npm install -g yarn
    - yarn -v
  override:
    - yarn
  cache_directories:
    - ~/.cache/yarn

test:
  override:
    - yarn test

When I run this on circle CI, I get yarn 23.4, but still get the same incompatibility error as before that I don’t get locally:

yarn -v
yarn install v0.23.4
[1/4] Resolving packages...
⠁ [2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
$ cd client && yarn install
yarn install v0.23.4
[1/4] Resolving packages...
⠁ ⠂ whatwg-fetch@^2.0.3⠄ yargs@^6.0.0⡀ yargs-parser@^4.2.0⢀ is-fullwidth-code-point@^1.0.0⠠ validate-npm-package-license@^3.0.1⠐ spdx-expression-parse@~1.0.0[2/4] Fetching packages...
error webpack@2.4.1: The engine "node" is incompatible with this module. Expected version ">=4.3.0 <5.0.0 || >=5.10".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

yarn -v returned exit code 1

Action failed: yarn -v

Any other ideas of what might be going on?

Thanks!!

Peter


#4

Hey Peter,

Can you try to rebuild without cache to rule out any node module corruption?

Best,
Lev


#5

Hi @levlaz, I just tried to rebuild without cache and got the same result.


#6

Hi @levlaz, Unfortunately, I’m still stuck on this and it’s completely blocking my efforts with Circle CI. I’ve sank a lot of time into trying to fix this myself and can’t justify much more. Is there anything else I should try before I abandon my effort with Circle CI? I’ve used your service before and really like it. If getting a paid plan would get me the support I need to get this project building, I’m totally open to that.

Thanks!

Peter


#7

I ran into this issue as well, and the way I was able to resolve it was by declaring the version of node to be used in the circle.yml.

I received this same error:

error webpack@2.4.1: The engine "node" is incompatible with this module. Expected version ">=4.3.0 <5.0.0 || >=5.10".

So my solution was to set the following:

machine:
  node:
    version: v6.1.0

I hope that helps.

hope


#8

I’m having a similar issue. I’m installing the latest version of yarn that supports git+ssh protocol and is not working.

machine:
  node:
    version: 7.8.0
  environment:
    PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"

dependencies:
  pre:
    - rm -rf ~/.yarn
    - npm i -g yarn
    - yarn -v
  override:
    - yarn
  cache_directories:
    - ~/.cache/yarn

test:
  override:
    - yarn run ci

[1/4] Resolving packages...
⠁ ⠂ twilio-chat@^0.13⠄ uuid@^3.0.1⡀ ws@^2.0.3⢀ ultron@~1.1.0⠠ locate-path@^2.0.0⠐ path-exists@^3.0.0[2/4] Fetching packages...
error An unexpected error occurred: "Invalid protocol: git+ssh:".
info If you think this is a bug, please open a bug report with the information provided in "/home/ubuntu/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

yarn -v returned exit code 1

Action failed: yarn -v

#9

Any help with this ? None the above answers seem to be working. I need latest version of yarn to support private git repositories.


#10

@bilby91: I gave up and started using Heroku CI, which I had zero setup issues with.


#11

This issue continues to pop up for me every time there is a node version bump.

Running a build without cache doesn’t help.

  - run:
      name: Yarn Install
      command: yarn install --cache-folder ~/.cache/yarn

  # Store yarn / webpacker cache
  - save_cache:
      key: yarn-cache-{{ checksum "yarn.lock" }}
      paths:
        - ~/.cache/yarn

closed #12

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.