Drone: how to npm install in service server?

there

I'm trying to use drone to deploy my project

Here's my .yml file and i got error bash: line 5: nvm: command not found when drone is deploying.

I'm sure I install nvm and source it in the ~/.profile

  • What's environment when Drone run nvm use 12.16.2 in script parts of this .yml? Is it in service server or still in Drone server's docker?
  • What can I do if I want to ssh to service server and to npm install?
      kind: pipeline
      type: docker
      name: default

      steps:
      - name: ssh deploy
        image: appleboy/drone-ssh
        settings:
          host:
            from_secret: SSH_HOST
          username:
            from_secret: SSH_USERNAME
          key:
            from_secret: SSH_KEY
          port: 22
          command_timeout: 2m
          # script_stop: true
          script:
            - cd /srv/xxx/xxx
            - eval "$(ssh-agent -s)"
            - ssh-add ~/.ssh/id_rsa
            - git fetch origin
            - git merge origin/master
            - nvm use 12.16.2
            - npm install
            - npm run build

      trigger:
        branch:
          - master
        event:
          - push

thx!