使用Grunt ENOTSUP [英] ENOTSUP using Grunt

查看:228
本文介绍了使用Grunt ENOTSUP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Grunt为AngularJS Web应用程序缩小和连接文件。我们的源代码位于文件共享上,我通过映射的驱动器连接到它。每当Grunt运行我的源代码目录时,我的一个concat任务就会出错。错误是ENOTSUP,在套接字上不支持操作。如果我复制源代码,本地,Grunt运行,很好。为了我们的源代码控制,我需要Grunt来监视和运行映射的驱动器。 concat任务使用grunt-contrib-concat。我试过重新安装Node并将grunt-contrib-concat回滚到版本0.4.0。这没有用。任何帮助/想法将不胜感激。



编辑:



Grunt中出现错误的代码是:

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

如果从上面的代码中删除'src / js / ** / *。js',并执行我的Grunt任务,则不会发生ENOTSUP错误。我需要使用这些通配符来包含所有目录和文件。

解决方案


$ b $我们在开始部署Azure时遇到了这个问题。 b

问题很可能是由 glob 中的错误引起的(Grunt对其有依赖性)。 p>

这个bug自修复以来已经很久了(请参阅 github issue 205 ),但遗憾的是最新的NPM稳定版本是0.4.5(两年前发布) - 它对glob 3.1.21(当前版本为6.0.4)有依赖性。



所以修复这个是:

a)通过从github克隆而不是使用npm





b)安装npm后,导航至 / node_modules / grunt 并执行 npm install glob@^6.0.4 --save 来升级安装的grunt版本的glob依赖项。



在您的deploy.sh中,npm install可能如下所示:

  eval $ NPM_CMD install 

您需要在它后面添加以下内容

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

注意;更改/ ** /到/ * /可以消除错误,但是您会放弃
递归副本。

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.

解决方案

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.

这篇关于使用Grunt ENOTSUP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆