Trying to run spsync, correctly configured, I get the following:
'debug-publish' errored after 947 ms
TypeError in plugin 'gulp-spsync'
Message:
Cannot read property 'indexOf' of undefined
The reason is that when getting the realm from target url, WWW-Authenticate doesn't exist in the response headers.
Resolved it by changing
var clientsvc = "/vti_bin/client.svc"
to
var clientsvc = "/_vti_bin/client.svc"
in index.js (Adding an underscore).