Javascript grunt sftp部署authKey ftppass
我通过grunt sftp部署(verbose)接收到这个错误 我刚开始使用grunt,只需要将通过sass生成的watch css上传到服务器上的某个点Javascript grunt sftp部署authKey ftppass,javascript,gruntjs,sftp,Javascript,Gruntjs,Sftp,我通过grunt sftp部署(verbose)接收到这个错误 我刚开始使用grunt,只需要将通过sass生成的watch css上传到服务器上的某个点 Registering "grunt-sftp-deploy" local Npm module tasks. Reading ***************\public\grunt\node_modules\grunt-sftp-deploy\package.json...OK Parsing
Registering "grunt-sftp-deploy" local Npm module tasks.
Reading
***************\public\grunt\node_modules\grunt-sftp-deploy\package.json...OK
Parsing
***************\grunt\node_modules\grunt-sftp-deploy\package.json...OK
Loading "sftp-deploy.js" tasks...OK
+ sftp-deploy
Loading "Gruntfile.js" tasks...OK
+ default
Running tasks: sftp-deploy
Running "sftp-deploy" task
Running "sftp-deploy:build" (sftp-deploy) task
Verifying property sftp-deploy.build exists in config...OK
Files: ../css -> /server/path
**Warning: .ftppass seems to be missing or incomplete Used --force, continuing.**
>> Concurrency : 4
Connection :: connect
**>> Error: Timed out while waiting for handshake
Fatal error: Connection :: error**
那么gruntfile.js就是这样的
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'sftp-deploy': {
build: {
auth: {
host: 'XXX.XXX.XXX.XXX',
port: 22,
authKey: 'key1'
},
cache: 'sftpCache.json',
src: '../css',
dest: '/server/path',
exclusions: [
],
serverSep: '/',
concurrency: 4,
progress: true
}
},
sass: {
dist: {
options: {
style: 'expanded',
noCache: true
},
files: [{
expand: true,
cwd: '../sass/pages',
src: ["**/*.scss"],
dest: '../css',
ext: ".css"
}]
}
},
watch: {
options: {
nospawn: true,
nocache: true,
livereload: true
},
sass: {
files: ['../sass/**/*.scss'],
tasks: ['sass']
},
sftp: {
files: ['../css/**/*.css'],
tasks: ['sftp-deploy']
}
}
});
grunt.loadNpmTasks('grunt-sftp-deploy');
grunt.registerTask('default', ['watch']);
};
Sass是对的,但我找不到为什么不将文件上传到服务器
那么我的问题是:
我错过了什么?
哪个路径应该是.ftppass.json?
现在和gruntfile.js是同一个地方,但我也有问题,我怀疑这是不对的。但是在sftp deploy gruntile.js设置中没有空间设置.ftppass.json。
如何正确设置路径
.ftppass.json
{
"key1": {
"username": "username",
"password": "pass"
}
}
它只是
.ftppass
,最后没有.json。将它放在与Grunfile.js相同的目录中即可您是否找到了解决方案?我也有同样的问题