windowsmacoscopygrunt-contrib-copy

Can't copy from Windows to OSX with grunt


Trying to grunt-contrib-copy files from a remote Windows 10 computer to OSX.

This all used to work perfectly for several years, For the last couple of months it's stopped working. It could have been around the time I upgraded the remote host to Win10, but can't be sure.

Trying to execute the following grunt task:

copy: {
        main: {
            files: [
                {
                    expand:true,
                    cwd: '/Volumes/Users/bobo/Projects/abc/',
                    src: [
                        'css/**', 
                        'img/**', 
                        'js/**', 
                        'icon.png', 
                        'index.html'
                    ],
                    dest: './www/'
                },                  
            ]
        }
    }

... fails with the following error (note that EINVAL equates to "invalid argument" in the *nix world):

Running "copy:main" (copy) task
Warning: Unable to read "/Volumes/Users/bobo/Projects/abc/css/MarkerCluster.Default.css" file (Error code: EINVAL). Use --force to continue.

What's interesting is that it traverses the tree correctly and finds a source file with no issues, but then responds with a failed copy.

All works if I remove any subdirectories:

src: [
    'css/**', 
    'img/**', 
    'js/**', 
    'icon.png', 
    'index.html'
],

Any ideas, or next steps to debug?


Solution

  • I finally tracked it down to an issue with SMB shares. I had to force OSX to only use SMB1 (not SMB2).

    The comand to run on OSX is:

    echo "[default]" >> ~/Library/Preferences/nsmb.conf; echo "smb_neg=smb1_only" >> ~/Library/Preferences/nsmb.conf