Yarn install failing on build

We are attempting to set up our project on CircleCI and are currently having it fail the build during the yarn install portion.

The error we are receiving is

$ sed -i ‘’ ‘s/#import <RCTAnimation/RCTValueAnimatedNode.h>/#import “RCTValueAnimatedNode.h”/’ ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h

sed: can’t read s/#import <RCTAnimation/RCTValueAnimatedNode.h>/#import “RCTValueAnimatedNode.h”/: No such file or directory

in our package.json we have a postinstall script that corrects this issue
"sed -i '' 's/#import <RCTAnimation\\/RCTValueAnimatedNode.h>/#import \"RCTValueAnimatedNode.h\"/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h"

the issue is we are having difficulties finding a way or where to place this in the config.yml or if that is the right route to go with the correcting the issue.

our config.yml looks like

jobs:
  build:
    working_directory: ~/project
    environment:
      LC_ALL: C.UTF-8
      LANG: C.UTF-8
    docker:
      - image: circleci/node:latest

    ## setup
    steps:
      - checkout

      - restore_cache:
          key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}

      - restore_cache:
          key: node-v1-{{ checksum "package.json" }}-{{ arch }}

      - run: yarn install

      - save_cache:
          key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
          paths:
            - ~/.cache/yarn

      - save_cache:
          key: node-v1-{{ checksum "package.json" }}-{{ arch }}
          paths:
            - node_modules

      ## run tests
      - run:
          name: jest tests
          command: yarn test

and advice or incite would be greatly appreciated

1 Like

Hi @drankin! Thanks for joining the community. I’m looking into this. Is the error stopping the build during a specific package? There were some issues that looked a little like this related to cocoapods, but I don’t know if that’s relevant to you.

@thekatertot Thanks for replying! I was actually able to resolve me issue. By removing the script from my package json.

"sed -i '' 's/#import <RCTAnimation\\/RCTValueAnimatedNode.h>/#import \"RCTValueAnimatedNode.h\"/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h"

Once we repushed the commit without the script. circleci is now building and running tests for us.

Sorry I didn’t update this thread

1 Like

No worries at all! I’m happy it was resolved :slight_smile:

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