Gulp-scp无法传输

浪费了一个下午

之前我用WinScp的同步功能, 但只要gulp clean, 就立刻报错, 无奈之下只好寻找相关的gulp组件

在npm下就有两个相关的gulp组件, 分别是gulp-scpgulp-scp2, 我一个个地说

Gulp-scp

NPM地址

https://www.npmjs.com/package/gulp-scp

配置如下

1
2
3
4
5
6
7
8
9
10
gulp.src('./build/index.html')
.pipe(scp({
"host": scpConf.host,
"port": scpConf.port,
"user": scpConf.username,
"path": "/www/"
}))
.on('error', function (error) {
console.log(err);
});

然并卵

可能是在Window下, 所以一直报错ssh: F: no address associated with name
所以, SKIP

Gulp-scp2

NPM地址

https://www.npmjs.com/package/gulp-scp2

配置如下

1
2
3
4
5
6
7
8
9
10
11
gulp.src('./build/index.html')
.pipe(scp({
"host": scpConf.host,
"port": scpConf.port,
"username": scpConf.username,
"password": scpConf.password,
"path": "/www/"
}))
.on('error', function (error) {
console.log(err);
});

然并卵

这个更过分, 连报错都没有, 就一直卡在那里…


Arylo Yeung, Typescripter, 暂留在鹅厂
tomail:arylo.open@gmail.com