FAQ Database Discussion Community


When starting Nightwatch with Grunt, the website server is not started

javascript,node.js,selenium,gruntjs,nightwatch.js
I am using Nightwatch.js to run system tests for a website. I want to automate the tests by running them via grunt. My Gruntfile contains these lines: ... var nightwatch = require('nightwatch'); nightwatch.initGrunt(grunt); ... nightwatch: { options: { standalone: true, test_settings: { "default": { "launch_url": "http://localhost", "selenium_port": 4444, "selenium_host": "localhost",...

JSLint error: “Expected a newline at EOF”, conflict with Beautify plugin

javascript,gruntjs,jslint,beautify
I have a problem while building the sources using Grunt, with JSLint task for error check: L177: Expected a newline at the end of the file. Warning: Formatting check failed. Use --force to continue. Aborted due to warnings. The problem is obvious, but I use also the Beautify plugin for...

I can not use grunt -cli and grunt serve in my web hosting

node.js,gruntjs,grunt-cli
I have developed a website on Node.js that runs perfectly on my local machine. I run my server with the command: $ grunt serve The problem is when i run my web application on my server online ( gandi server ). I can't use the command $ grunt serve Because...

How to define bourbon and neat in grunt js file / windows 8 user?

gruntjs,bourbon,neat
I'm trying to use this code and I get error for using "loadPath" duplicated. options: { style: "compressed", sourcemap : true, loadPath: require('node-bourbon').includePaths, loadPath: require('node-neat').includePaths }, ...

When using Libsass/Grunt is there a way to watch files on the fly?

css,sass,gruntjs,zurb-foundation-5,libsass
I have installed Foundation 5 using >gem install foundation And then creating a new project using the command >foundation scratch --libsass The main reason being is that I'm on Windows and I really don't need/want to be using compass. I know that after I make changes to my sass files...

Run parametrized task using grunt.task.run(taskname)

gruntjs
I did stackoverflow search and looked at Grunt API docs but couldn't find a way to run a parametrized task using grunt.task.run(taskname). I have a simple task which accepts a parameter and prints the message on console: grunt.registerTask('hello', 'greeting task', function(name) { if(!name || !name.length) grunt.warn('you need to provide a...

Is there a way with Grunt to automatically link css files to HTML

html,css,gruntjs
I am just wondering if there is a way to automatically link css files to HTML. For example just give the files (dependencies) path and it will be automatically stylesheet link to the specific HTML file. Thank you...

Message appears when running scsslint

sass,gruntjs
I am following the step by step on https://www.npmjs.com/package/grunt-scss-lint I have installed everything, and seems to be working fine when I type in Terminal 'scss-lint'. However I want this to be running in Grunt Gruntfile: scsslint: { allFiles: [ 'src/scss/**/*.scss', ], options: { bundleExec: true, config: '.scss-lint.yml', reporterOutput: 'scss-lint-report.xml', colorizeOutput:...

How to configure Grunt with ASP.NET WebApi Project?

angularjs,asp.net-web-api,gruntjs
I am new to grunt and i want to use this with my current Asp.Net WebApi Single Page Application. For that purpose i want to know how we can configure Grunt with ASP.NET Project.. I am using Visual Studio 2013...

$http.get returns actual php script instead of running it (yeoman, grunt)

php,angularjs,pdo,gruntjs
I'm building a "simple" AngularJS app with an articles newsfeed. My articles are stored in a mysql database, and I extract them using php PDO. I used to do this using AJAX with a simple LAMP configuration (php5, mysql, apache2), and everything worked as intended. Now I'm trying to rebuild...

Error using Grunt watch and SASS

node.js,sass,gruntjs
I am trying to use grunt watch t with SASS on Windows, but everytime I get an error Waiting... OK >> File "scss\main.scss" changed. Running "sass:dist" (sass) task Error: Error generating source map: couldn't determine public URL for the source stylesheet. No filename is available so there's nothing for the...

Meteor Not Excluding Node Modules in the Private Folder?

javascript,node.js,meteor,gruntjs,isobuild
I'm adding my own grunt build setup to my meteor project and assumed from the docs that if I put it into the private folder, it would be left alone by iso-build. Alas this is not the case, and all manner of hell breaks loose. I'd like to know why?...

rethinkdb does not connect form grunt task

node.js,gruntjs,rethinkdb
I created a grunt task to create tables in a rethinkDB database. the issue that i am facing is that the connection is never established and no tables are created however if i do the same while serving a regular API endpoint everything works as expected. below is an extract...

Add locale moment to an AngularJS app

angularjs,gruntjs,momentjs
I'm trying to configure the locale language for an AngularJS app based on Yeoman. When I serve the dist package after building my app (grunt build), the script reference dissapears. Here's a list of my dependencies on the index.html file. <!-- build:js(.) scripts/vendor.js --> <!-- bower:js --> <script src="bower_components/jquery/dist/jquery.js"></script> <script...

Why doesn't postinstall run everytime?

jenkins,gruntjs,npm
I have a package.json file that has the following JSON at the bottom. "scripts": { "postinstall": [ "./node_modules/bower/bin/bower install && ./node_modules/protractor/bin/webdriver-manager update" ] } My reason for having this is so bower dependencies and my protractor tests will run after an "npm install". However, it seems that "postinstall" doesn't always...

Can I use grunt/gulp to pull a specific version of bootstrap css

twitter-bootstrap,gruntjs,gulp
I'm working on a build process that will compile bootstrap css with my overrides. I would like to specify a version of bootstrap in my config and have grunt/gulp go and get the .less files for that version and then compile them. Is there any plugin or process to have...

Loading “Gruntfile.js” tasks…ERROR while running `grunt`

javascript,gruntjs,grunt-contrib-watch,grunt-contrib-concat
I'm new to the Grunt world. After installing grunt-cli, and all the dependencies, here is my : Gruntfile.js /* Grunt installation: ------------------- npm install -g grunt-cli npm install -g grunt-init npm init (creates a `package.json` file) Project Dependencies: --------------------- npm install grunt --save-dev npm install grunt-contrib-concat --save-dev npm install grunt-contrib-watch...

How to include only specific parts of UI Bootstrap using Grunt

gruntjs,angular-ui-bootstrap,bower
I'm using the accordion, tooltips and transition components of UI Bootstrap. I can create a custom build with the online tool on the UI Bootstrap website, which will create a minified and non-minified JS file containing only the components I selected, without overhead. However, I don't want to use the...

Images doesn't display on AngularJS website after uploading them with filezilla

angularjs,image,website,gruntjs,filezilla
I created an AngularJS project. With doing the grunt serve, grunt serve:dist commands in my terminal, my images are loaded. I upload my page to a webserver with filezilla, but on the public webpage my images are not found. I discovered that the images in my dist folder 2 extensions...

How do I compile mutliple HTML Jade templates that use the same mixin

html,node.js,gruntjs,jade
mixin hero(title) .hero .hero__inner h1.hero__title #{title} So, my project uses a Jade mixin like the above on multiple pages and, when I compile the Jade to HTML pages, I have to copy that mixin on each page that it is used. I can compile the pages using either grunt-jade or...

Grunt not outputting, returning error

node.js,maven,gruntjs,output,stdout
I run a website which uses Grunt to collect all of my assets into a compiled bundle (translating Less into CSS, translating TS into JS, running tests, etc.). I recently moved to a new computer. Although my source files (including package.json, Gruntfile, pom.xml, etc.) are store in the project's Git...

Compass file path errors in Grunt

angularjs,gruntjs,yeoman,compass,grunt-contrib-compass
in Gruntfile.js: compass: { options: { sassDir: '<%= yeoman.app %>/styles', cssDir: '.tmp/styles', generatedImagesDir: '.tmp/images/generated', imagesDir: '<%= yeoman.app %>/images', javascriptsDir: '<%= yeoman.app %>/scripts', fontsDir: '<%= yeoman.app %>/styles/fonts', importPath: '<%= yeoman.app %>/bower_components', httpImagesPath: '../images', httpGeneratedImagesPath: '../images/generated', httpFontsPath: '/styles/fonts', spriteLoadPath: '<%= yeoman.app %>/styles/sprites/', relativeAssets: true,...

ENOTUP using Grunt

javascript,node.js,gruntjs,minify,grunt-contrib-concat
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,...

What does slash dot refer to in a file path?

windows,git,gruntjs,filepath,slash
I'm trying to install a grunt template on my computer but I'm having issues. I realized that perhaps something different is happening because of the path given by the Grunt docs, which is %USERPROFILE%\.grunt-init\ What does that . mean before grunt-init? I've tried to do the whole import manually but...

Visual Studio 2015: Destination wwwroot/css/site.css not written because no source files were found.

gruntjs,visual-studio-2015
I'm trying to use grunt in my ASP project, but for whatever reasons have get a stupid warning-message from Visual Studio. How you can see down, the bower-task has been executed, but haven't uglify- and less-tasks. Gruntfile.js and folder "wwwroot" are in the same folder. What's wrong ? This is...

Grunt tasks stuck in endless loop

javascript,node.js,gruntjs,npm,grunt-contrib-concat
Working on putting together a base Gruntfile.js for some upcoming projects. Starting in on a new computer so everything has been a fresh build. Installed Node and NPM using Homebrew, and then installed Grunt globally, as well as in my local directory. Here is my package.json: { "name": "timespent-prototype", "version":...

grunt-contrib-copy syntax for process option confusion

gruntjs,grunt-contrib-copy
I'm trying to replace some placeholders in different files as I copy. My gruntfile works fine, but adding in the process option to do the replacements, it's just not working. Below is the relevant section of my gruntfile: grunt.initConfig({ copy: { js: { files: [{ expand: true, cwd: 'src/wp-content/themes/pilau-starter/', src:...

Running grunt just opens up a Notepad file instead of actually running the tasks

javascript,gruntjs
I'm trying to create a basic Grunt file to execute some tasks. Trouble is, when I execute grunt from within the directory of the project, a Notepad file opens, displaying the contents of grunt.js rather than actually running. I've also tried naming the file Gruntfile.js but then I get a...

pass middleman variable to grunt file

javascript,gruntjs,html-email,middleman
My middleman template has an 'id' variable that I put my html emails job name into. I know if I change my middleman erb file from index.html.erb to newName.html.erb it will output that as the final files name. My problem is that most of my grunt tasks require the file...

With Grunt, how can I compile all *.less files, if I have global mixins and constants?

gruntjs,less,grunt-contrib-less
I want to organize my HTML, JS, and LESS by module. I'm already using Grunt to compile *.js and *.html from my source folders. So I configured grunt as follows: grunt.initConfig({ less: { ALL: { files: { 'compiled.css': '**/*.less' } } } } But this runs into a major problem:...

Sailsjs with angularjs npm install error

angularjs,gruntjs,npm,sails.js
i am using sails js backend and frontend angularjs. i have given npm install. npm install package show this error: npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer grunt-contrib-clean@0.6.0 wants grunt@~0.4.0 npm ERR! peerinvalid Peer grunt-contrib-coffee@0.13.0 wants grunt@>=0.4.0 npm ERR! peerinvalid...

Error 'uiGrid' must have exactly one root element. ui-grid/ui-grid when UI-Grid is initiated

angularjs,gruntjs,ng-grid,angular-ui-grid
While trying to add ui-grid to an angular project, I came across this issue. I’ve bootstrapped the angel;ar application with ui-grid dependency injected. var app = angular.module(‘myApp’,
 ['ui.bootstrap',
 'services',
 'filters',
 'directives',
 'controllers',
 'ui.grid'
 ]); The controller looks like this. angular.module('controllers').controller('UIGridCtrl',function UIGridCtrl($scope) {
 $scope.init = function(){
 $scope.myData = [
 {"firstName": "Cox",...

Grunt-contrib-copy: variables within the rename function

javascript,gruntjs,grunt-contrib-copy
I have the following copy task in a gruntfile.js copy: { css: { expand: true, cwd: 'min/css', src: 'theme_<%= props.majorversion %>.<%= props.minorversion %>.min.css', dest: 'dest/dir/', rename: function(dest, src) { return dest + src.replace('_<%= props.majorversion %>.<%= props.minorversion %>',''); } } } Currently, the file is copied successfully but once copied, I'd...

Rails minify/optimize files on the fly using Grunt or Gulp

ruby-on-rails,gruntjs,gulp,sidekiq
My Rails 4 application allow it's users to import some Adobe Edge animation files (advertisement). While it works, Adobe Edge is loading a bunch of files that could be minified and optimized (images) using a tool like Grunt or Gulp. I'm using CarrierWave to upload the files and then I...

Node module to execute tasks grunt : “Gruntfile.js” not find

javascript,node.js,command-line,gruntjs
I'm currently trying to develop a module that will allow node to run Grunt tasks from the command line. This Node module is installed globally : C:\Users\pcharpin\AppData\Roaming\npm\node_modules\task-app The goal is that the use of "Grunt" commands is transparent to the user. To better explain my approach, a simple example of...

Changing JS variable with Grunt for different environments

javascript,build,gruntjs,environment-variables
I'm trying to configure my JS build to do next: I'm using a JS variable to define the application root: globals.js define(function (require) { "use strict"; return { mainRoot: "http://myapp.com" //mainRoot: "http://localhost:3000" - local run //mainRoot: "http://myapp-test.com" - test server }; }); During local development I'm using code without Grunt...

Handlebars does not output anything

javascript,gruntjs,handlebars.js,yeoman,bower
At the start of the file I define Handlebars etc.: <!-- build:js(.) scripts/vendor.js --> <!-- bower:js --> <script src="bower_components/jquery/dist/jquery.js"></script> <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script> <script src="bower_components/handlebars/handlebars.js"></script> <!-- endbower --> <!-- endbuild --> At the end of the index.html-file I pull in my Handlebars-file: <!-- build:js({app,.tmp}) scripts/main.js --> <script...

Grunt inject CSS file into