Tag: gruntjs

如何判断npm包是全局还是本地安装的

我正在windows7上安装grunt,node,npm,bower和grunt-cli。 说明说我应该运行带有-g标志的全局安装命令。 如何检查我安装时是否使用了-g标志。 卸载并重新安装需要很长时间。

运行“grunt”命令时出现“致命错误:无法find本地grunt”

我用下面的命令卸载了grunt。 npm uninstall -g grunt 然后我再次用下面的命令安装了grunt。 npm install -g grunt-cli 请访问以下链接: https : //npmjs.org/package/grunt-html 我想使用上面的咕噜插件 但是当我运行grunt命令时,它给了我下面的错误: D:\nodeJS\node_modules\grunt-html>grunt grunt-cli: The grunt command line interface. (v0.1.6) Fatal error: Unable to find local grunt. If you're seeing this message, either a Gruntfile wasn't found or grunt hasn't been installed locally to your project. For more information about installing […]

用nodejsreplace文件中的string

我使用md5 grunt任务来生成MD5文件名。 现在我想用任务callback中的新文件名来重命名html文件中的源文件。 我想知道最简单的方法是什么。

列出grunt.js任务

我正在努力解决如何打印所有可用的grunt任务列表。 用耙子将是: $ rake -T 什么是咕噜声的等价物? 例如 $ grunt -T CONCAT 茉莉 缩小

使用Grunt.js复制将所有文件从目录复制到另一个目录

我试图将目录中的所有文件复制到另一个目录作为我的构build过程的一部分。 它适用于我明确指定的单个文件,但是当我尝试复制整个目录时,它会像复制完整的目录结构(或根本就没有)那样奇怪。 这里是我的GruntFile.js的相关部分: copy: { myvoice: { files: [ { src:"src/html/index.html", dest:"dist/myvoice/index.html" }, { src:"src/html/css/style.css", dest:"dist/myvoice/css/style.css" }, { src:"src/html/js/require.js", dest:"dist/myvoice/js/require.js" }, { src:"build/myvoice/main.js", dest:"dist/myvoice/js/main.js" }, { src:"src/html/css/fonts/*", dest:"dist/myvoice/css/fonts/" } ] } }, 具体来说,这是我无法工作的最后一行: { src:"src/html/css/fonts/*", dest:"dist/myvoice/css/fonts/" }

在Grunt Task中运行一个命令

我在我的项目中使用Grunt (JavaScript项目的基于任务的命令行构build工具)。 我创build了一个自定义标签,我想知道是否可以运行一个命令。 澄清,我试图使用闭合模板和“任务”应该调用jar文件预编译大豆文件到一个JavaScript文件。 我从命令行运行这个jar,但我想把它设置为一个任务。

咕噜扔“recursionprocess.nextTick检测”

我使用nodejs v0.10.26运行Lion 10.9.2 我想在sass文件上设置一个自动编译,并用grunt实时重新加载,没有什么复杂的,但是… 运行grunt watch ,出现以下错误 (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. util.js:35 var str = String(f).replace(formatRegExp, function(x) { ^ RangeError: Maximum call stack size exceeded 这里是Gruntfile.js module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), sass: { dist: […]

grunt-contrib-copy中有什么“扩展”选项? 这些例子都使用它,但文档没有说明它的function

这里是自述文件和示例: https : //github.com/gruntjs/grunt-contrib-copy/blob/master/README.md 。 这里是从https://github.com/gruntjs/grunt-contrib-copy/blob/master/tasks/copy.js代码的相关部分(我显然不明白): module.exports = function(grunt){ “严格使用”; var path = require('path'); grunt.registerMultiTask('copy','Copy files。',function(){ var kindOf = grunt.util.kindOf; var options = this.options({ processContent:false, processContentExclude:[] }); var copyOptions = { 过程:options.processContent, noProcess:options.processContentExclude }; grunt.verbose.writeflags(options,'Options'); var dest; var isExpandedPair; var tally = { dirs:0, 文件:0 }; this.files.forEach(function(filePair){ isExpandedPair = filePair.orig.expand || 假; filePair.src.forEach(function(src){ if(detectDestType(filePair.dest)==='directory'){ dest […]

没有提供“框架:茉莉花”! (解决:框架:茉莉花)

当我运行命令grunt我得到以下警告: Running "karma:unit" (karma) task Warning: No provider for "framework:jasmine"! (Resolving: framework:jasmine) Use –force to continue. 有谁知道如何解决这个问题?

grunt:从terminal运行时找不到命令

我是Grunt的新手。 我正在尝试在Mac OSX Lion上configurationGrunt。 我按照这里的说明,然后创build一个包含下面的文件的项目文件夹。 当我尝试通过在terminalinput“grunt”来运行时,我command not found 。 我也修改了我的pathsudo nano /etc/paths ,希望添加path将使任务亚军工作,但它仍然无法正常工作。 有人可以协助这个吗? —paths /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/local/bin/grunt — files node modules Gruntfile.js package.json