简体   繁体   English

当yarn是运行命令时,使用npm的circleci(v2.0)

[英]circleci (v2.0) using npm when yarn is the run command

There's documentation on setting up yarn for circleci v1 but not v2 because it appears as though they've got yarn baked into the v2 api, however, in my config.yml i explicitly run yarn to install my deps yet, when i review the build logs it shows that npm is used for all my yarn commands... I obviously need to override this / install yarn? 有关于为circleci v1设置纱线的文档,但没有为v2设置纱线的文档,因为看起来好像已经将纱线烘焙到v2 api中了,但是,在我的config.yml中,当我查看构建时,我明确地运行yarn来安装我的部门记录它显示npm用于所有我的yarn命令...我显然需要覆盖此/安装yarn? Unfortunately it appears that the v2 docs don't touch on this and my google-foo isn't being fruitful... 不幸的是,似乎v2文档没有涉及到这一点,而且我的google-foo并未取得成果...

what's more interesting is that another one of my projects IS using yarn with almost the exact same config... what gives? 更有意思的是,我的另一个项目是使用几乎完全相同的配置的yarn。

heres my current config.yml 这是我当前的config.yml

# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: circleci/node:7.10

      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/mongo:3.4.4

    working_directory: ~/repo

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run: yarn

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

      # run tests!
      - run: yarn test
      - run: echo "ALL GOOD IN THE HOOD"
      - deploy:
          name: Deploy on deploy branch
          command: |
            if [ "${CIRCLE_BRANCH}" == "deploy" ]; then
              ./node_modules/.bin/firebase ...
            fi

I figured out the problem. 我解决了这个问题。 My circleci folder was misspelled. 我的circleci文件夹拼写错误。 I omitted the . 我省略了. and it was using a default config... sigh... 它使用的是默认配置...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM