Having issues building node project while using the new orbs

Hi guys, I’ve tried a few variations of the following however was unable to get this to run correctly. Does anyone know the correct way to do this? Do I have to specify a docker container? The orb example with the hello world script led me to believe that is no longer necessary.

version: 2.1

orbs:
  node: circleci/node@1.0.1

workflows:
  build:
    jobs:
      - node/install
      - node/install-npm
      - run:
        command: |
          npm install
          npm run build
      - store_artifacts:
          path: /

version: 2.1

orbs:
  node: circleci/node@1.0.1

workflows:
  build:
    jobs:
      build:
        steps:
          - node/install
          - node/install-npm
          - run:
            command: |
              npm install
              npm run build
          - store_artifacts:
              path: /

@Arimil node/install and node/install-npm are commands, not jobs, so your first example definitely won’t work:

https://circleci.com/orbs/registry/orb/circleci/node#commands

Your second example looks fine, mostly, but you’ll still have to define that build job somewhere—and yes, that means you need to choose an execution environment (probably a Docker image) where it will run. You can use the executor included in the node orb, though, which makes it easy:

executor: node/default

Also, it looks like you have a YAML indentation issue in your run step code. Running circleci config validate on your local machine before pushing to GitHub is always a good way to iron out those kinds of issues ahead of time:

https://circleci-public.github.io/circleci-cli/circleci_config_validate.html

Thanks, I got it working however it seems using the node executor fails since some node modules require make. I went back to using the node docker image since it has those dependencies.

Unfortunately the circleci cli doesn’t run on Windows afaik.

Hmm, well I’m glad you got it working, but that’s a bit strange, as the Node executor is really just an abstraction over CircleCI’s Node Docker image:

And it should definitely have make installed.

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