简体   繁体   中英

how to use pm2 to deploy to Windows stack

Environment

  • Development machine: Windows 7
  • Deploy target: Windows 2012 r2
  • NodeJS version v7.10.1
  • Git git-bash 2.9.2.windows.1

I am trying to deploy a NodeJS project using PM2

PM2 deploy

My PM2 ecosystem file

 deploy : {
        production : {
          user : 'myUser',
          host : '10.1.1.16',
          ref  : 'origin/master',
          repo : 'pshakr@bitbucket.org/pjma/adapter.git',
          path : 'C:\\jhu',
          'post-deploy' : 'npm install && pm2 startOrRestart ecosystem.config.js --env production'
        }
      }

I have opened GIT-Bash on my development machine and getting the following error while running config file

Error

$ pm2 deploy ecosystem.config.js production setup
--> Deploying to staging environment
--> on host 10.1.1.16
  ○ hook pre-setup
ssh: connect to host 10.1.1.16 port 22: Connection refused

  setup paths failed

Deploy failed

Will PM2 allow me to deploy to a Windows server? any pointers on how to resolve that?

It looks like you may need to install SSH server on the Windows 2012r2 server

what-is-a-good-ssh-server-to-use-on-windows

sshwindows

Not sure if that will resolve the PM2 deploy, but should explain the connection refused on port 22

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM