Node version in 2.0


With CircleCI 2.0 I’m unable to set the version of node.js - regardless of what image I use it always uses v4.2.6

A way to define the latest and/or stable version of node in .yml

On 2.0 you can build a container and install what you need.


Yes but doesn’t it stand to reason that a container tagged as node:8.0 would have node.js v8.0 installed? I really want to use circle but headaches like this…


Can you clarify what you’re doing to see those results? Everything looks fine.

$ docker run -it circleci/node:8.0 bash
circleci@cb5b1c27de50:/$ node --version
circleci@cb5b1c27de50:/$ npm --version


I’m seeing the same thing. I’m specifying the 7.1 image but getting 4.2.6 in tests.

If I use debug ssh I can see the wrong node version:

ubuntu@box800:~$ node --version

My config.yml

version: 2
      - image: circleci/node:7.10
          NODE_ENV: test

      - image: postgres:9.5
          POSTGRES_USER: ubuntu
          POSTGRES_DB: test
    working_directory: ~/repo

      - checkout

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

      - run: npm install

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

      - run:
          name: Wait for db
          command: dockerize -wait tcp://localhost:5432 -timeout 1m

      # run tests!
      - run: npm test


Resolved this. :flushed:

Someone pushed to a branch that didn’t have a .circleci/config.yml while I was testing. I didn’t notice this when I hit Rebuild with SSH, so I rebuilt the build that was without a config, and so, obviously, it had the wrong node version.

(unsurprisingly) Rebuilding on a branch with a config.yml solved it.


Glad you got this sorted. Reminds me of this blog post I wrote. Notably, “Working on Teams Can Be Hard”.


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