ENOTSUP using Grunt
Asked Answered
A

1

4

I'm using Grunt to minify and concatenate files for an AngularJS web application. Our source is on a file share and I'm connecting to it via a mapped drive. Whenever Grunt runs over my source directory, I get an error on one of my concat tasks. The error is "ENOTSUP, operation not supported on socket". If I copy the source, local, Grunt runs, fine. For the sake of our source control, I need Grunt to watch and run over the mapped drive. The concat task uses grunt-contrib-concat. I've tried reinstalling Node and rolling back grunt-contrib-concat to version 0.4.0. That didn't work. Any help/ideas would be greatly appreciated.

Edit:

The code in Grunt that gives the error is:

  jscustom: {
            src: ['src/js/*.js', 'src/js/**/*.js', 'build/temp/templates.js'],
            dest: 'build/temp/custom.js'
}

If I remove "'src/js/**/*.js'," from the code, above, and excute my Grunt task, the ENOTSUP error does not occur. I need to use those wild cards to include all directories and files.

Abbott answered 12/5, 2015 at 19:23 Comment(3)
I've, also, attempted to connect to the share with an mklink /D. That gives me the same error.Abbott
By the way; would you be so kind to add 'azure-deployment' tag to this question? Perhaps this might be usefull to others as well...Kershner
@Kershner I've added the tag. Thanks, again.Abbott
K
18

We've ran into this problem when we started deploying to Azure.

The problem is most likely caused by a bug in glob (on which Grunt has an dependency).

This bug is long since been fixed (see github issue 205), but unfortunately the latest stable release on NPM is 0.4.5 (published two years ago) - which has an dependency on glob version 3.1.21 (current version is 6.0.4).

So fixes for this are either:

a) get grunt by cloning from github instead of using npm

or

b) after npm install, navigate to /node_modules/grunt and execute an npm install glob@^6.0.4 --save to upgrade the glob dependency of the installed grunt version.

In your deploy.sh, the npm install may look like this:

eval $NPM_CMD install

You'll want to add the following right after it

pushd ./node_modules/grunt
eval $NPM_CMD install glob@^6.0.4 --save
popd

Note; changing the /**/ to /*/ gets rid of the error, but then you give up the recursive copy.

Kershner answered 2/2, 2016 at 12:47 Comment(8)
Thanks for the info. I've updated glob in grunt and this appears to be working!Abbott
You're welcome -- I was in doubt whether adding this answer would help anyone, but I'm glad I've taken the time since apparently it did. :)Kershner
I have a shared node instance at Azure and cannot run command line queries. How can I fix this? I am using latest version of grunt & glob.Voyles
hi @Teomanshipahi, do you mean you don't have sufficient rights to get to a console? Or that you don't know how? If you add .scm. between you instance name and azurewebsites.net in the url (e.g. mysite.scm.azurewebsites.net), you ought te get access to Kudu service site - and there you can access the debug console.Kershner
@Kershner this helps a lot. Thanks for sharing that information.Voyles
Thanks @Kershner I also had to add this to my general deploy.cmd for Azure App Service because my passport strategies weren't loading in my yeoman meanjs template site. Kept getting endless redirects to /server-error because I had added optional basic authentication.Emaciation
@Kershner Thank-you! You saved me at least an hour of debugging and trying possible solutions.Crosswind
Woot! Thank you very much. This is fixing it. Had the issue on a fresh Windows 10 installation. Just a note: The same error did not happened on my previous windows 7 system.Labarum

© 2022 - 2024 — McMap. All rights reserved.