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: UseNode@1
            displayName: Install NodeJS
            inputs:
              version: "14.x"
              checkLatest: true

          - task: Npm@1
            displayName: Install dependencies
            inputs:
              command: "install"

          - task: Npm@1
            displayName: Updating dependencies
            inputs:
              command: "custom"
              customCommand: "update"

          - task: CmdLine@2
            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: CmdLine@2
            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.