乙烯基-ftp奇怪的错误 [英] Vinyl-ftp strange error
本文介绍了乙烯基-ftp奇怪的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
gulp.task('ftp-test-connection',function(){
var conn = ftp.create({
host:'hostname',
user:'user',
password:'password',
parallel:10 ,
log:gutil.log
});
var globs = [
。./styles/**/*{css,png,jpg,gif ,ttf,woff,eof,svg,woff2}',
'./images/**',
'./views/**',
'./scripts/vendor。 scripts.min.js',
'./dist/index.html',
'./dist_test/main.scripts.min.js',
'./dist_test/web。 config'
];
return gulp.src(globs,{base:'。',buffer:false})
.pipe(gulpIf('dist / index.html ',rename({dirname:''})))
.pip e(gulpIf('dist / web.config',rename({dirname:''})))
.pipe(gulpIf('dist_test / main.scripts.min.js',rename({dirname:' / scripts'})))
.pipe(conn.newer('/ site / wwwroot'))
.pipe(conn.dest('/ site / wwwroot'));
});
这里是我的错误
**
[11:31:59]错误错误:用户无法登录。
在makeError(C:\ node_modules \ vinyl-ftp\\\
ode_modules\\ \\ ftp\lib\connection.js:1067:13)在解析器中
。< anonymous> (C:\ node_modules \vinyl-ftp\\\
ode_modules\ftp\lib\connection.js:113:25)在emitTwo(events.js:87:13)
at Parser.emit(events.js:172:7)
at Parser._write(C:\\\
ode_modules\vinyl-ftp\\\
ode_modules\ftp\lib\parser.js:59:10)
at doWrite(_stream_writable.js:292:12)
在writeOrBuffer(_stream_writable.js:278:5)
在Parser.Writable.write(_stream_writable.js:207:11)
在Socket.ondata(C:\ node_modules \ vinyl-ftp \ node_modules \ftp\lib\connection.js:273:20)
在emitOne(events.js:77: 13)
在Socket.emit(events.js:169:7)
at readableAddChunk(_stream_readable.js:146:16)
在Socket.Readable.push(_stream_readable.js:110 :10)
at TCP.onread(net.js:523:20)(530)
进程以代码1结束。
**
解决方案
ulp和Azure App Services(又名Azure网站)。
在我的情况下,问题是由Azure FTP用户名中包含的\字符引起的。
我只需加倍\(例如:someuser \ $ someuser)即可解决问题。
我希望它有帮助。 ..
M。
I am using Vinyl-ftp to do deployment, when i try to connect with FileZilla or Total Commander everything works ok, but when i try wirh Gulp task i got strange error, i dont see the difference, here is my Gulp task and error message
gulp.task('ftp-test-connection', function () {
var conn = ftp.create({
host: 'hostname',
user: 'user',
password: 'password',
parallel: 10,
log: gutil.log
});
var globs = [
'./styles/**/*{css,png,jpg,gif,ttf,woff,eof,svg,woff2}',
'./images/**',
'./views/**',
'./scripts/vendor.scripts.min.js',
'./dist/index.html',
'./dist_test/main.scripts.min.js',
'./dist_test/web.config'
];
return gulp.src(globs, { base: '.', buffer: false })
.pipe(gulpIf('dist/index.html', rename({ dirname: '' })))
.pipe(gulpIf('dist/web.config', rename({ dirname: '' })))
.pipe(gulpIf('dist_test/main.scripts.min.js', rename({ dirname: '/scripts' })))
.pipe(conn.newer('/site/wwwroot'))
.pipe(conn.dest('/site/wwwroot'));
});
And here is my error **
[11:31:59] ERROR Error: User cannot log in.
at makeError (C:\node_modules\vinyl-ftp\node_modules\ftp\lib\connection.js:1067:13)
at Parser.<anonymous> (C:\node_modules\vinyl-ftp\node_modules\ftp\lib\connection.js:113:25)
at emitTwo (events.js:87:13)
at Parser.emit (events.js:172:7)
at Parser._write (C:\node_modules\vinyl-ftp\node_modules\ftp\lib\parser.js:59:10)
at doWrite (_stream_writable.js:292:12)
at writeOrBuffer (_stream_writable.js:278:5)
at Parser.Writable.write (_stream_writable.js:207:11)
at Socket.ondata (C:\node_modules\vinyl-ftp\node_modules\ftp\lib\connection.js:273:20)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)
at TCP.onread (net.js:523:20) (530)
Process terminated with code 1.
**
解决方案
I faced the same issue with "vinyl-gulp" and Azure App Services (a.k.a. Azure Web Sites).
In my case the problem was caused by the "\" character contained on the Azure FTP username. I just had to double the "\" (ex: "someuser\$someuser") to solve the issue.
I hope it helps...
M.
这篇关于乙烯基-ftp奇怪的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文