Publish to Cloudflare with Azure Pipeline keeps failing

I am trying to deploy my website by running a pipeline in Azure DevOps but I keep getting this error message:

Error: config path does not exist /home/vsts/.wrangler/config/default.toml. Try running wrangler login or wrangler config

This is my pipeline:

trigger:
  - none

pool:
  vmImage: "ubuntu-latest"

stages:
  - stage: deployDEV
    displayName: Stage DEV

    jobs:
      - job: Build
        displayName: Build and deploy Web DEV
        pool:
          vmImage: "ubuntu-latest"

        steps:
          - task: [email protected]
            displayName: Install NodeJS
            inputs:
              version: "14.x"
              checkLatest: true

          - task: [email protected]
            displayName: Install dependencies
            inputs:
              command: "install"

          - task: [email protected]
            displayName: Updating dependencies
            inputs:
              command: "custom"
              customCommand: "update"

          - task: [email protected]
            displayName: Build DEV application
            inputs:
              script: |
                echo "Running build"
                npm install -g @cloudflare/wrangler
                npm install -g gatsby-cli 
                GATSBY_ACTIVE_ENV=development gatsby build

          - task: [email protected]
            displayName: Publish to Cloudflare
            inputs:
              script: |
                echo "Publishing to CLoudflare"
                echo $CF_ACCOUNT_ID
                wrangler publish --env dev


Instead of going with npm global install, you could use npx.
Also, I don’t see when you pass your token as an ENV Variable.