Use custom node version for android image

I need to use custom node version 12.8.1 for detox test cases and the one installed on the VM is 14.6.x … I tried using nvm and even n to get it to work but seems nothing happens.

My config.yml

android-detox-testing:
    machine:
      image: android:202102-01
      
    steps:
      - run:
          name: output current node version
          command:  node -v
      - run:
          name: "Update Node.js and npm"
          command: |
            curl -sSL "https://nodejs.org/dist/v12.8.1/node-v12.8.1-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v12.8.1-linux-x64/bin/node
            curl https://www.npmjs.com/install.sh | sudo bash
      - run:
          name: output updated node version
          command: node -v

Can anyone guide how to use specific node version in the build.

Hi @ShubhankSG! I think this Support article should help. You can install and swap node versions using Node Version Manager as shown here