CNode

node 处理 The authenticity of host '' can't be established.

问答
Mmeooxx发布于8 年前最后回复8 年前0 回复2968 浏览0 收藏

The authenticity of host 'github.com (13.250.177.223)' can't be established. RSA key fingerprint is SHA256:xxxxxxxxxxxxxxx Are you sure you want to continue connecting (yes/no)? Host key verification failed.

这段提示为什么 stdout.on('data') stderr.on('data') 都获取不到


const sub = cp.spawn(
    'bash', 
    {
      cwd: `${rootDir}/gh-pages`
    }
  )

  sub.stderr.setEncoding('utf-8')
  sub.stdout.setEncoding('utf-8')

  try {
    await sub.stdin.write(`
      pwd \n
      git init \n
      git config user.name "xxx"
      git config user.email "xxxx48@gmail.com"
      git remote add origin ${gitAddr} \n
      git add . \n
      git commit -m "gh-pages" \n
      git status \n
      git push origin HEAD:gh-pages -f \n
    `)
   // await  sub.stdin.end()

  }catch(err) {
    console.log("err: ", err)
  }
  


  sub.stdout.on("data", (data) => {
    console.log("onData:", data)
   
  })

  sub.on('exit', (...rest)=> {
    try{sub.stdin.write('yes\n')}
    catch(err) {
      console.log("exit err: ", err, rest)
    }
  })

  
  sub.stderr.on('data', data=>{
    console.log('stderr: ', data)
    process.exit(1)

  })

}
查看回复

回复 (0)

暂无回复,成为第一个参与讨论的人。
参与回复
登录后即可参与回复。登录