Grunt-ssh gives - Error: No such file on upload

I'm having problems using the grunt-ssh plugin. So far I have written test code to test the functionality before using it in a real environment. This is my grunt file:

module.exports = function(grunt) {

  // Project configuration.
    secret: grunt.file.readJSON('secret.json'),

    sftp: {
        test: {
            files: {
                "./": "Data/**/*.css"
            options: {
                path: 'TEST/',
                host: '<%= %>',
                username: '<%= secret.username %>',
                privateKey: "<%= %>"//,
                //createDirectories: true


  // Default task(s).
  grunt.registerTask('default', ['sftp:test']);



The secret.json is straightforward and works, so I won't post it here.

My question is why is grunt giving me an error that looks like this:

Connection :: connect
copying Data/test1/test.css to TEST/Data/test1/test.css
>> Error: No such file
Connection :: end
Connection :: close
SFTP :: session end


If I uncomment the createDirectories parameter, the grunt file adds the correct folders in the correct location, but the file is not copied. So I am assuming the rights are correct.

Could it have something to do with my operating system and Windows is booting into a Unix server? The folder structure with the createDirectories parameter is right though ...

Thanks for your help in advance guys!


source to share

1 answer

Meybe this is because of directoryPermissions. You should try the following:

directoryPermissions: parseInt('755', 8)




All Articles