Error: Create directory operation failed.
Hi @morris , I met some problem when I upload files to server. I'm pretty sure the host, username and password are correct. We have 2 ftp servers. It works well when I upload to one server of them. But the other one gave me the error in console like error in console below.
Environment
| C/S | OS | Version |
|---|---|---|
| Client | Windows | 10 |
| FTPServer | CentOS | 6.7 |
gulpfile.js :
var gulp = require('gulp');
var gutil = require('gulp-util');
var ftp = require('vinyl-ftp');
function getTestConnection() {
return ftp.create({
host : '[xxx.xxx.xxx]',
user : '[xx]',
password : '[xxxxxx]',
parallel : 10,
log : gutil.log
});
}
gulp.task('deploy', function () {
var conn = getTestConnection();
var globs = [
'src/**',
'css/**',
'js/**',
'fonts/**',
'index.html'
];
// using base = '.' will transfer everything to /public_html correctly
// turn off buffering in gulp.src for best performance
return gulp.src(globs, {
base : '.',
buffer : true
})
.pipe(conn.newer('/var/vinyl-ftp/')) // only upload newer files
.pipe(conn.dest('/var/vinyl-ftp/'));
});
error in console :
[10:57:44] Using gulpfile E:\research\gulp\upload\gulpfile.js
[10:57:44] Starting 'deploy'...
[10:57:44] CONN
[10:57:44] READY
[10:57:44] MLSD /var/vinyl-ftp
[10:57:44] MLSD /var
[10:57:44] MLSD /var/vinyl-ftp/src
[10:57:44] MLSD /
[10:57:44] MLSD /var/vinyl-ftp/css
[10:57:44] MKDIR /var
[10:57:44] 'deploy' errored after 95 ms
[10:57:44] Error: Create directory operation failed.
at makeError (E:\research\gulp\upload\node_modules\ftp\lib\connection.js:1067:13)
at Parser.<anonymous> (E:\research\gulp\upload\node_modules\ftp\lib\connection.js:113:25)
at emitTwo (events.js:106:13)
at Parser.emit (events.js:191:7)
at Parser._write (E:\research\gulp\upload\node_modules\ftp\lib\parser.js:59:10)
at doWrite (_stream_writable.js:307:12)
at writeOrBuffer (_stream_writable.js:293:5)
at Parser.Writable.write (_stream_writable.js:220:11)
at Socket.ondata (E:\research\gulp\upload\node_modules\ftp\lib\connection.js:273:20)
at emitOne (events.js:96:13)
[10:57:45] DISC
I'm wonder why it run this command _[10:57:44] MKDIR /var_ since the _/var_ dir does exist!!! Expecting your answer
This is probably related to #3
Does it work with 0.5.0?
Hi @morris , Thanks for your answer. I ran
npm install --save-dev [email protected]
to install vinyl-ft of 0.5.0. And I got the same error as before.
check the target directory whether has the enough right to write, and the owner of it is specified user not root