XCode version 9.3.1 yarn errors

xcode
yarn
#1

yarn 1.6 and node 10 causes errors. There is an update on version 1.7

1 Like
#2

Can you just install Yarn 1.7 yourself? I assume it would overwrite 1.6, but if not, just use the fully-qualified path to the new version.

#3

In my build i already add run command to install the new version.

#4

Ah right, so you don’t have a problem per se then, just suggesting that the Yarn version is bumped up? Does it all work for you with the new version?

#5

no it is not working…
On my computer it does:

yarn -v
1.7.0
node -v
v10.4.0

SSH to machine with xcode: “9.3.1”

brew upgrade yarn
...
yarn -v
1.7.0
node -v
v10.4.0

test are failing with

/Users/distiller/RepApp/node_modules/react-native/jest/setup.js: babel-plugin-jest-hoist: The module factory of jest.mock() is not allowed to reference any out-of-scope variables.
Invalid variable access: console
Whitelisted objects: Array, ArrayBuffer, Boolean, DataView, Date, Error, EvalError, Float32Array, Float64Array, Function, Generator, GeneratorFunction, Infinity, Int16Array, Int32Array, Int8Array, InternalError, Intl, JSON, Map, Math, NaN, Number, Object, Promise, Proxy, RangeError, ReferenceError, Reflect, RegExp, Set, String, Symbol, SyntaxError, TypeError, URIError, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray, WeakMap, WeakSet, arguments, expect, jest, require, undefined, DTRACE_NET_SERVER_CONNECTION, DTRACE_NET_STREAM_END, DTRACE_HTTP_SERVER_REQUEST, DTRACE_HTTP_SERVER_RESPONSE, DTRACE_HTTP_CLIENT_REQUEST, DTRACE_HTTP_CLIENT_RESPONSE, global, process, Buffer, clearImmediate, clearInterval, clearTimeout, setImmediate, setInterval, setTimeout.
Note: This is a precaution to guard against uninitialized mock variables. If it is ensured that the mock is required lazily, variable names prefixed with mock are permitted.

#6

I assume you are doing yarn -v at the SSH console. Are you sure that is what you are running in your CI? Consider adding a yarn -v inside your run steps to ensure it is seeing the right one. Remember the PATH may be different between a CI run and the console.

#7

i was using the right console :slight_smile: . Removing node_modules directory and running yarn shows the right version (1.7.0)
There is a new image with xcode version “9.4.0” with yarn 1.7 and node 10.4 but my test are failing too (same error as above).
On my machine everything is ok with yarn 1.7 and node 10.4. I getting errors only with yarn 1.6 and node 10.4. (removed node_modules dir and installed dependencies on my mac too, but sill working)

For clarity: I have a react native (v.0.52) project with jest tests.
my circleci.yml

version: 2

jobs:
  static(level1):
    macos:
      xcode: "9.4.0"
    working_directory: /Users/distiller/RepApp
    shell: /bin/bash --login -o pipefail
    steps:
      - checkout
      - run:
          name: install dependencies
          command: yarn
      - run:
          name: unittests
          command: yarn testci
      - run:
          name: lint
          command: yarn lint
      - run:
          name: flow
          command: yarn flow
      - store_artifacts:
          path: /Users/distiller/RepApp/output
      - store_test_results:
          path: /Users/distiller/project/RepApp/scan

workflows:
  version: 2
  test_development:
    jobs:
      - static(level1):
          filters:
            branches:
              ignore:
                - master
                - develop

yarn testci just running test without --watch option
package.json:

"scripts": {
...
    "testci": "node node_modules/jest/bin/jest.js",
...
},
#8

Sorry to press this point, but I am not sure if my response was understood. Would you add a new run step containing yarn -v? It may be different to the answer you get in an SSH session.

#9

no i add a run step with “brew upgrade yarn”. Still get errors, so I decited to rerun job with ssh and try to check verstions etc.

#10

Right. You are checking in the wrong place, in my view. You need to reassure yourself that your CI is running the right version. Put the version command (temporarily) in a run step.

#11

my new circleci.yml

version: 2

jobs:
  static(level1):
    macos:
      xcode: "9.4.0"
    working_directory: /Users/distiller/RepApp
    shell: /bin/bash --login -o pipefail
    steps:
      - checkout
      - run:
          name: check version before update
          command: yarn -v && node -v
      - run:
          name: brew upgrade yarn
          command: brew upgrade yarn
      - run:
          name: check version after update
          command: yarn -v && node -v
      - run:
          name: install dependencies
          command: yarn
      - run:
          name: unittests
          command: yarn testci

results:

check version before update00:02

Exit code: 0

#!/bin/bash --login -o pipefail
yarn -v && node -v

1.7.0
v10.3.0

yarn upgrade faild:

Error: yarn 1.7.0 already installed
Exited with code 1

I will update only node to version 10.4

please wait… :slight_smile:

#12

cicleci.yml

version: 2

jobs:
  static(level1):
    macos:
      xcode: "9.4.0"
    working_directory: /Users/distiller/RepApp
    shell: /bin/bash --login -o pipefail
    steps:
      - checkout
      - run:
          name: check version before update
          command: yarn -v && node -v
      - run:
          name: brew upgrade yarn
          command: brew upgrade node
      - run:
          name: check version after update
          command: yarn -v && node -v
      - run:
          name: install dependencies
          command: yarn
      - run:
          name: unittests
          command: yarn testci

version before:
yarn -v && node -v

^D^D1.7.0
v10.3.0

version after:

yarn -v && node -v

^D^D1.7.0
v10.4.0

still the same error… =>

no errors on image with xcode “9.3.0”

#13

I thought you were trying to upgrade Yarn, but this is saying that the version of Yarn has not changed, only Node. I guess that is because you have now bumped up to Xcode 9.4.

It strike me that the suggestion on the other thread, which was that bumping Yarn to 1.7 would fix it, is not the case here. Is that right?

Right, I see. What versions of Node and Yarn are in use there?

Could you lock onto 9.3.0 instead of 9.3.1 or 9.4.x? Do you need to upgrade?

#14
  • first i used image version “9.3.1” and upgraded yarn and node. => errors
  • on announcement Xcode 9.3.1 Released for CircleCI 2.0 marc replied there is a new release with node 10.3 and yarn 1.7
  • so i tried “9.4.0” => errors
  • updated node on “9.4.0” to version 10.4 => still errors

can’t determine the differences between my mac and the machine with “9.4.0” => I can use xcode “9.3.0”. Just wanted you to know about the errors :slight_smile:

1 Like
closed #15

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