# Yarn install failing on build

**URL:** <https://discuss.circleci.com/t/yarn-install-failing-on-build/36641>\
**Category:** Build Environment\
**Tags:** circle-yml\
**Created:** [July 10, 2020, 2:21pm UTC](https://discuss.circleci.com/t/yarn-install-failing-on-build/36641 "2020-07-10T14:21:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drankin](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@drankin](https://discuss.circleci.com/u/drankin)\
**Post date:** [July 10, 2020, 2:21pm UTC](https://discuss.circleci.com/t/yarn-install-failing-on-build/36641/1 "2020-07-10T14:21:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thekatertot](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/thekatertot/32/25169_2.png) [@thekatertot](https://discuss.circleci.com/u/thekatertot)\
**Post date:** [July 13, 2020, 8:53pm UTC](https://discuss.circleci.com/t/yarn-install-failing-on-build/36641/2 "2020-07-13T20:53:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![drankin](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@drankin](https://discuss.circleci.com/u/drankin)\
**Post date:** [July 13, 2020, 9:10pm UTC](https://discuss.circleci.com/t/yarn-install-failing-on-build/36641/3 "2020-07-13T21:10:00Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![thekatertot](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/thekatertot/32/25169_2.png) [@thekatertot](https://discuss.circleci.com/u/thekatertot)\
**Post date:** [July 13, 2020, 9:10pm UTC](https://discuss.circleci.com/t/yarn-install-failing-on-build/36641/4 "2020-07-13T21:10:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [July 23, 2020, 9:11pm UTC](https://discuss.circleci.com/t/yarn-install-failing-on-build/36641/5 "2020-07-23T21:11:07Z")

</div>

Closed on July 23, 2020, 9:11pm UTC

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