Tag: gruntjs

Component-preload.js生成

我们即将closures一个SAPUI5应用程序,最后一个步骤是制作一个Component-Preload.js文件来提高性能。 我在网上阅读不同的指南,他们都需要我已经安装的Node.js。 我不是那个包的专家,我不知道如何使这个指南的工作。 我正在开发NetBeans。 据我所知,没有一个官方的工具(我是吗?)来生成该文件。 能有比我更有经验的人能提出一个有效的,明确的指导来完成这个任务吗? 我不知道这是否可以帮助,这是我的工作树:

stream浪汉提供,不能开始咕噜

我试图让stream浪汉安装nodejs正常运行所需的所有东西。 然后,在节点项目的根文件夹上执行“nohup grunt server&”之后,我期望服务器在端口3030上监听,但事实并非如此。 如果正确的configuration后,我做stream浪ssh咕噜服务器& 所有的工作,因为它应该。 只有当configuration器运行它不起作用。 这是我的Vagrantfile的一部分: git clone https://github.com/airbnb/rendr.git cd /home/temp/rendr/examples/00_simple/ npm install cp -rf /home/temp/rendr/examples/00_simple/ /home/website/nodejs/rendr-try1 cd /home/website/nodejs/rendr-try1/00_simple nohup grunt server & 所以它肯定似乎与没有在terminal上运行的提供者有关,但是有没有简单的方法来让这个运行没有像新贵那样?

咕噜的Nodeunit找不到模块“点击”

所以,在本教程中 ,我决定添加一些unit testing到我的node.js应用程序。 我gruntfile似乎是好的,当我inputgrunt nodeunit我唯一的testing运行得很好,但之后,它崩溃与错误Fatal error: Cannot find module 'tap' : $> grunt nodeunit Running "nodeunit:all" (nodeunit) task Testing db.test.js .OK Fatal error: Cannot find module 'tap' 我对这个模块一无所知,但是在googliing之后,似乎是nodeunit需要的东西。 实际上,存在$MY_NODE_APP/node_modules/nodeunit/node_modules/tap ,当我在$MY_NODE_APP/node_modules/nodeunit启动节点并在交互式控制台中inputrequire('tap')时,的东西,给我一个印象,它的工作原理应该。 所以,显而易见的问题是:为什么我得到这个错误,我该如何解决? Gruntfile: module.exports = function(grunt) { grunt.initConfig({ nodeunit: { all: ['./**/*.test.js'] } }); grunt.loadNpmTasks('grunt-contrib-nodeunit'); }; 更新 :安装了我的项目,但它也没有帮助。

Grunt.js安装问题 – 找不到命令

我试图让我的工作机器上设置grunt.js 。 现在我已经设法在家里build立了,所以我把我的存储库,然后克隆在我的工作机器,但是,尽pipe解决这个到死亡我总是遇到同样的问题,当我来试图运行在我的工作电脑上的命令; sh.exe": grunt: command not found 所以一些背景和解释; 我正在使用Aptana 3.0并通过terminal运行所有的命令。 (这适用于我的家庭和工作电脑) 我克隆了“工作”仓库,并把它放在我的工作机器上的一个文件夹中,所以我有我的package.json和gruntfile.js文件在目录中。 这些在我的家用电脑上工作正常,我可以在家里成功运行设置在我的gruntfile.js的监视任务。 我运行npm install grunt-cli -g和npm install在我的工程计算机上的项目中,每次安装都成功。 我唯一的错误信息是缺乏描述和存储库字段,据我所知这些不是强制性的? 我的仓库内的节点模块文件夹指示我有以下安装(根据我的package.json) grunt grunt-contrib-compass grunt-contrib-uglify grunt-contrib-watch matchdep 现在,我对这个命令行的东西非常绿色,所以我可能忽略了一些非常明显的东西,但是我觉得我已经尝试了所有的指导来让这个东西起作用。 尽pipe通过重复的入门步骤/安装grunt文档,似乎不pipe我做什么,terminal都不会把grunt作为一个公认的命令。 我是愚蠢的还是这个其他问题? 编辑1:我的package.json的内容: { "name" : "xxxxxxxxx", "version" : "xxxx", "dependencies" : { "grunt":"~0.4.1", "grunt-contrib-watch": "~0.5.3", "grunt-contrib-compass": "~0.5.0", "grunt-contrib-uglify": "~0.2.2", "matchdep": "~0.1.2" } }

Chaivariables不是由Karma / Grunt加载的

我不能让chai在业力/咕噜声中承诺。 运行grunt test或karma test/karma.conf.js时,出现以下错误: PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR ReferenceError: Can't find variable: chai at /Users/isaac/Sites/ChessGame/node_modules/chai-as-promised/lib/chai-as-promised.js:19 这看起来和这个问题类似,但是我正在承担起这个问题,而不是sin-cha。的。 我已经validation了node_modules/chai/chai.js存在。 这是我的package.json文件: { "name": "chessgame", "private": true, "devDependencies": { "angular-mocks": "^1.4.3", "chai": "^3.2.0", "chai-as-promised": "^5.1.0", "chai-things": "^0.2.0", "grunt": "^0.4.5", "grunt-angular-templates": "^0.5.7", "grunt-autoprefixer": "^2.0.0", "grunt-concurrent": "^1.0.0", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-compass": "^1.0.0", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-connect": "^0.9.0", "grunt-contrib-copy": "^0.7.0", "grunt-contrib-cssmin": […]

“sudo npm install -g grunt-cli”给我一个错误

当我尝试在Linux 12.04上安装gruntjs时(出现镜像包的源代码),我得到一个错误。 这是错误: sudo npm install -g grunt-cli npm ERR! Error: ENOENT, open '/home/havetl/.npm/d63f3d0b-grunt-cli.lock' npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <npm-@googlegroups.com> npm ERR! System Linux 3.5.0-23-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli" npm ERR! cwd /home/havetl […]

Nodeunit没有检测到done()

试图加快node.js和nodeunit的速度,但是在nodeunit中发现一个问题,在其中一个testing中没有看到对test.done()的调用。 代码: // Added for clarity. var client = require("restify").createJsonClient({ "version": "*", "url": "http://localhost:" + server.Port }); exports["tests"] = { "setUp": function (callback) { server.StartServer(); callback(); }, "tearDown": function (callback) { callback(); }, "CanIHaveSomeTeaPlease?": function (test) { test.expect(4); client.get("/tea", function (err, req, res, data) { test.equal(err.statusCode, 418, "Expected ImATeapot Error."); test.equal(err.message, "Want a biscuit?", "Expected […]

与grunt安装有问题

我跟着grunt网站上的文档。 执行sudo npm install -g grunt-cli我得到了这个输出 npm http GET https://registry.npmjs.org/grunt-cli npm http 304 https://registry.npmjs.org/grunt-cli npm http GET https://registry.npmjs.org/findup-sync npm http GET https://registry.npmjs.org/nopt npm http GET https://registry.npmjs.org/resolve npm http 304 https://registry.npmjs.org/resolve npm http 304 https://registry.npmjs.org/findup-sync npm http 304 https://registry.npmjs.org/nopt npm http GET https://registry.npmjs.org/abbrev npm http GET https://registry.npmjs.org/glob npm http GET https://registry.npmjs.org/lodash npm http 304 https://registry.npmjs.org/abbrev npm […]

所有任务完成后如何执行callback函数?

我使用下面的代码: grunt.task.options({ done: function() { grunt.log.writeln('build success'); } }); 但不工作,希望你的帮助,谢谢!

在Bluemix部署期间运行Grunt任务

我有一个令人兴奋的Node应用程序,我想从Heroku上托pipe到Bluemix。 部署运行各种任务有点复杂,由我的package.js文件的一部分启动: "scripts": { "start": "node app.js", "postinstall": "grunt heroku" }, 咕task任务开始在我的Gruntfile.js文件中find依赖的对话,比如拉入Bower包,缩小图像,浏览,移动,文件,清理等等。 我推测在推送到Bluemix时,我可以启动部署任务? 如果是这样,他们是否会以类似的方式完成( package.json脚本部分的命令)来运行我的Gruntfile.js定义的任务? 在heroku中,我的整个git repo将被复制到远程,所以一切都在那里,不仅仅是运行脚本的输出来生成一个dist目录,我假设这对Bluemix是一样的吗? 最后,在我的包文件中,我将定义npm和节点版本: "engines": { "npm": "2.5.1", "node": "0.12.0" } Heroku会确保它运行的是特定于我的实例的版本。 Bluemix是否一样? 非常感谢你! 保罗