Questions tagged [gruntjs]

Grunt stands as a command line build tool and task runner specifically designed for JavaScript projects, providing efficient task-based functionalities.

Is it possible for me to connect an npm run command as a task in a Gruntfile?

In the root directory of my site, I have made changes to the package.json file by adding the "scripts" hook below: "scripts": { "ngDeployDev": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command ../../Scripts/ng-build-deploy/ngDeployDev.p ...

Utilizing Grunt to streamline a personalized project

I have set up Grunt as my "JS Task Runner". Node.js is installed in the directory "C:/Program Files". NPM has been installed in C:/users/Peterson/appdata/roaming/npm. Inside the npm folder, I have Grunt, Bower, and Grunt-cli. I am working on a pro ...

Enhancing the 'grunt build' process with partials for an AngularJS app

Is there a way to modify my Grunt file to ensure that it locates the partial views correctly? The grunt.js file I am using is the default one created when initializing an AngularJS application with Yeoman. It does not include any plugins or jQuery, just A ...

Oops! Looks like we encountered a fatal error while running the unit tests. Unfortunately, the unit

After setting up the project environment and successfully installing grunt, I attempted to run grunt in the terminal which resulted in the following output: https://i.stack.imgur.com/4xnll.png I proceeded to follow the steps. Running grunt build --env ...

HTML 5 - GRUNT BUILD: The error message "Fatal error: Object has no method 'compact'" is causing issues with the build process

Currently, I am working on a project using GRUNT. However, I encountered an error while building the project: Running "cuff:dev" (cuff) task >> Building src/pages/home Fatal error: Object home.less has no method 'compact' The erro ...

"Uh-oh, looks like we've hit a snag: the module '../time/convert' is nowhere to be found. This issue seems to be

I recently set up a new Angular project on Linux, committed it to Git, and then cloned it onto Windows. Using Bower and NPM, I successfully loaded everything except for one error that only occurs on Windows. Upon performing a recursive grep search for ../ ...

What are the steps for creating the yeoman "angular-generator" application for production?

My angular application was initially created using "yeoman" with the command "yo angular" and included grunt sass bootstrap, resulting in a project size of 200mo when including all dev features like node_modules and bower_components. I am looking for guid ...

When utilizing auth0, an error occurs during the grunt build process

I successfully developed a small project using AngularJS on my local machine without encountering any issues. However, when I attempted to build the project with Grunt, everything stopped working and an error occurred: vendor.ce3c01a3.js:2 Error: [$inject ...

Utilize Grunt to retrieve a JSON object from a file

I'm interested in utilizing the grunt-hash plugin to rename my JavaScript files. This plugin generates a new file that contains a map of renamed files: hash: { options: { mapping: 'examples/assets.json', //mapping file so your server can serve ...

Is it possible to recursively copy everything using grunt-contrib-copy but excluding certain parts of the directory structure?

I have a directory structure set up like this: +-- gruntfile.js | +-- src/ | | | +-- lib/ | | | +-- imgs/** | | | +-- js/** Now, I am looking to create a distribution folder using grunt-contrib-copy: +-- gruntfile.js | ...

Which tool would be better for starting a new Angular project: angular-seed or yeoman?

I'm having trouble deciding on the best approach to create a new AngularJS application. There seem to be various methods available, such as using angular-seed from https://github.com/angular/angular-seed or yeoman - http://www.sitepoint.com/kickstar ...

Issue encountered while executing tasks in the Gruntfile.js file

Having trouble with Grunt concatenating my CSS files into one named production.css Below is the output I received from the command prompt: C:UsersjoshaDesktopReposAJAX Project - Grunt Test>grunt C:UsersjoshaDesktopReposAJAX Project - Grunt ...

Utilizing sprites for high-resolution displays with SASS/Compass

Currently, I am experimenting with the SASS/Compass sprite library and attempting to set up my sprite to accommodate 3 different icon sizes: 1x, 1.5x, and 2x (retina). This is how I have imported the folders: @import "icons10/*.png"; @include all-icons10 ...

Guide to transferring parameters from one function to another in Javascript

For my automation project using Protractor and Cucumber, I have encountered a scenario where I need to use the output of Function A in Function B. While I was able to do this without Cucumber by extending the function with "then", I am facing difficulties ...

Unable to add npm package at this time

Feeling a bit desperate right now. I recently implemented npm and grunt to enhance my development process, which was working smoothly until today. Suddenly, I'm unable to install npm packages and keep encountering the following error message: 0 info ...

The operation of "grunt build" results in a Lexer Error, causing the ng-include

After deploying my unminified code successfully, I proceed to run grunt build and deploy from the dist folder. However, upon checking one of the pages, I encounter a breakage with an error in the console: Error: [$parse:lexerr] Lexer Error: Unexpected nex ...

Gruntjs Live Reload is actively monitoring for changes, yet fails to refresh the page

Check out my Gruntfile.js here Also, take a look at my package.json here I ran npm install in the main directory of my workspace (using WAMP) and it created a node_modules folder along with several subfolders. After navigating to the directory c:\w ...

Best practices for configuring Jade with Yeoman and Grunt for efficient templating

I am struggling with integrating layouts and partials effectively in my project. Can someone provide guidance on the correct setup? Currently, I am using grunt-contrib-jade. Here is my current file structure: app |_jade | |_layouts | | ...

Struggling to make the grunt.js task for postcss with autoprefixer function properly

I am currently facing issues with using postcss in conjunction with autoprefixer-core. Even though the css is being generated correctly, autoprefixer doesn't seem to be applying any prefixes. I have already installed postcss and autoprefixer via NPM and m ...

The command "grunt" isn't found

npm is aware that grunt has been globally installed, so why can't it be located? $ npm install -g grunt ... installs ... $ npm list -g | grep grunt │ ├─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2a5b0b7acb6a4a ...

Jenkins script ending abruptly while attempting to run npm install on a Windows machine

When setting up my Jenkins job, I encountered an issue with building a JavaScript app using Grunt. The Jenkins build scripts are supposed to create a build directory (if it doesn't exist), navigate to that directory, and execute the following commands: np ...

npm encountered an error with code EPEERINVALID, indicating an issue with

Welcome, I'm a new member here and encountering an npm ERR! code EPEERINVALID. Currently, my setup includes: nvm 0.32.1 npm 2.15.9 node v4.5.0 grunt-cli v1.2.0 grunt v0.4.5 While attempting to upgrade a package or module, I came across the following ...

The system cannot locate the "default" task. Please consider using the --force option to proceed. The process has been halted due to warnings

Below is the content of my gruntfile.js file var fs = require("fs"), browserify = require("browserify"), pkg = require("./package.json"); module.exports = function(grunt) { grunt.initConfig({ mochaTest: { test: { options: { ...

Optimal project folder organization for a web application utilizing Grunt alongside npm, bundler, and composer

Currently, I have a project set up for a web application using Grunt to automate build tasks. SASS and Compass are used for styling, while Composer manages PHP dependencies. The folder structure looks like this: -project |-build |-node_modules |-src | ...

After running the Grunt build, the Angular call to PHP results in a 404

I'm really in need of some guidance here, as I'm quite lost building my first ng-app. The issue lies with the Grunt build results where the api calls (php) are not being found. My folder structure consists of dist->api->index.php, so it's puzzling to me w ...

How to have multiple versions of grunt coexisting on a single machine

I am involved in two different projects that have unique requirements for Grunt versions: Project A specifically needs Grunt v0.3.2 Project B requires Grunt v0.4.1 Both of these projects are managed in separate workspaces. Currently, I have Grunt v0.4. ...

Alert: The flattening operation is not a recognized function. Proceed with --force option to proceed

I've encountered a strange error with Grunt. After some time in our CI system, the task grunt assemble:site starts to fail and outputs the following warning: Running "assemble:site" (assemble) task Warning: flatten is not a function Use --force to continu ...

Grunt is unable to execute due to an error message stating, 'Module failed to self-register'

One of my machines is able to run Grunt using npm 1.4.28, while the other machine with npm -v 2.5.1 cannot. How can I downgrade the npm version on the latter machine? What should I do if the desired previous version is not accessible? ...

Grunt jade compiler populating attributes with default values

When using the grunt-contrib-jade module to compile my Jade templates, I encountered an issue. If I leave my attribute blank, like in this line of code: article(ui-view) The compiled output becomes: <article ui-view="ui-view"></article> Thi ...

Inconsistencies in grunt-ng-constant target operations

I encountered a strange issue with grunt-ng-constant where only 2 out of the 3 targets are working. Here is how my configuration is set up: grunt.initConfig({ ngconstant: { options: { space: ' ', wrap: '"use strict";&bso ...

Messing up Bootstrap ES6 JavaScript code leads to the problem of the "Modal redeclared" error

Encountering the issue of "Modal redeclared" when attempting to minify Bootstrap 4 JS code using Grunt. Discovered these are due to ES6 so found the ES6 Uglify for Grunt. Current dependencies include: "bootstrap": "~4.0.0", "grunt": "~1.0.1", "grunt-contr ...

Grunt Pokes at XML to Set a Variable Destination Name

When using grunt-xmlpoke to update an XML file, the path of the XML file is provided as a parameter. The issue arises when the first WebConfigPath (key) in the files section is interpreted as a string. This results in updating a local copy of the XML fil ...

Mastering the use of regular expressions with Grunt J

grunt.config('sass', { options: { sourceMap: true }, dist: { options: { outputStyle: 'expanded' }, files: { '/css/site.css': 'main/scss/site.scss', '/c ...

Error: No targets with the name "taskname" were found for the custom Grunt task

Just recently, I decided to create my own custom task and here's the process: Started by making an empty folder named "custom-tasks" in the Document Root Next, I created the actual task file: "mytask.js" Implemented the functionality required for th ...

What is the process for enabling SASS line numbers using Yeoman's Grunt.js file?

Recently, I used Yeoman (1.4.5) to scaffold a new web application. Within my Gruntfile.js, I configured it as follows: ... // When requested, compile Sass to CSS and generate necessary files sass: { options: { lineNumbers:true, sourceMap: true, ...

`Grunt.js watch for Browserify`

Hi there! I'm just starting to explore Grunt.js. Up until now, my process involved running: browserify ./js/app.js -o ./js/app.bundle.js each time a file was changed and saved. Now, I am aiming to streamline this by using Grunt (version 0.4.2) wat ...

What is the proper way to configure the checklist-model directive in my AngularJS application?

I'm new to the node.js/grunt world, so please bear with me if my question seems basic... I have an angular.js project set up with yeoman/grunt, and now I want to add a directive, specifically this one. However, I'm unsure of how to install it! So far, ...

Acquiring data within a jade template in order to generate static HTML pages

I am struggling to pass data to a jade template in order to generate static content. While I am not well-versed in node.js and express, I use jade as a template engine for creating static html. Many of the requests in the jade issue list pertain to includ ...

When initiating the Grunt Express Server, it prompts an issue: Error: ENOENT - the file or directory 'static/test.json' cannot be found

I'm currently in the process of updating my app to utilize the Express Node.js library. As part of this update, I have made changes to my Grunt.js tasks to incorporate the grunt-express-server package. However, after running the server successfully, I ...

Unable to locate "Gruntfile.js" Node module for task execution

I am currently in the process of developing a module that enables node to execute Grunt tasks via the command line. This Node module is globally installed at : C:\Users\pcharpin\AppData\Roaming\npm\node_modules\task-app ...

Can Gulp be configured to work in a distributed manner?

Let me walk you through my plan: I aim to create a node package that includes: gulpfile.js All necessary gulp plugins, tasks, and configurations. To implement this node package (referred to as "my-gulp" henceforth) into an Angular app (referred to ...

Having trouble getting grunt-sass to compile properly, resulting in empty output files

My grunt script was functioning properly until now: module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), sass: { dev: { options: { so ...

Error encountered with :jshint-junit-reporter

After creating a demo for jshint with Grunt, the code is as follows: module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('jshint-junit-reporter'); grunt.initConfig({ jshint: { a ...

From where does the require.js file originate?

Currently, I am learning Angular 2 from the tutorial available at https://github.com/pkaul/maven-typescript-example. Once I proceed with the 3rd step (mvn jetty:run), a runnable war folder is generated in the example-webapp/target directory. However, I ha ...

Grunt is throwing an error message of "Cannot GET/", and unfortunately ModRewrite is not functioning properly

I've recently started using Grunt (just began last Friday). Whenever I run Grunt Serve, it displays a page with the message "cannot GET/" on it. I tried implementing the ModRewrite fix but the error persists. Any assistance would be highly appreciat ...

The npm-cache is packed with hundreds of pre-installed packages

After installing node.js and npm on my new Windows 7 machine via the msi installer, I discovered a cache of 150 packages in my users//appdata/roaming/npm-cache directory. How did they end up there? It doesn't seem like the msi installer did it. I'm curiou ...

Executing task automation using Grunt

I am facing an issue while trying to run a build system using grunt. Whenever I attempt to execute the command npm install -g grunt-cli, I encounter errors as shown in the attached images. Even though I have already installed grunt-cli, I am puzzled by all ...

Generate - Create 2 different versions of the web application

Currently, I am in the process of learning Grunt and exploring ways to generate 2 variations of an application with different configuration settings. My goal is to have one version where a boolean in a specific .js file is set to false, and another versio ...

Ordering the source files for the Grunt index task using globbing

Currently, I am utilizing VS2015 along with a grunt task in order to gather all the java-script files within my project and then insert them into my template index.html before executing the build. The issue that arises is the dependency order of these file ...

Refresh Angular with HTML5 mode

I have disabled my # using html5 mode in Angular.js and am utilizing grunt and node as a development server. However, whenever I try to reload or refresh the page, I encounter a 404 error. Can anyone provide guidance on how to configure the node server in ...

What is the best way to initiate a TouchEvent in a qunit test being run by grunt using only vanilla JavaScript?

I have implemented callbacks for different touch events that require testing. For example, the 'touchstart' event utilizes touch coordinates to configure a class member: NavigationUI.prototype.touchStart = function(evt) { this.interacting = true; ...

When attempting to install a specific version of Grunt using NPM, an error message

I've been working on setting up grunt because the grunt watch command isn't functioning properly. It keeps showing an error message: grunt command not found. Even after trying to install it using npm install <a href="/cdn-cgi/l/email-protection" class ...

Reducing the size of CSS classes and IDs

I am searching for a way to automatically compress classes and ids in an .html file. This specific file is generated through a sequence of gulp commands. I attempted to use the Munch command line application, but it had adverse effects on the file by elimi ...

The specific Local Npm module named "GRUNT-PLUGIN-MODULE" could not be located. Have you installed this module? What could be the reason for its absence?

Steps to integrate your new grunt-plugin module with your project. Here is an example of directory structure: |-- xyz-project | |-- ... | |-- app.js | |-- Gruntfile.js --> `grunt.loadNpmTasks('my-custom-grunt-plugin');` | -- p ...

Combine angular ui router templates using grunt into a single file

Currently, I am working on an angular-ui-router project that consists of 150 files scattered all over. My goal is to create a grunt task that will merge all these files into a single index.html file structured like this: <script type="text/ng-template" ...

Grunt is currently not executing any tasks other than the watch command

I'm currently working on a Bootstrap website and utilizing Grunt to automate tasks. However, I seem to be encountering an issue with my gruntfile as it is only running the 'watch' task and not executing any other tasks. Despite no errors sho ...

Unable to locate a resolution for the error message "Warning: Task "uglify" not found"

Below is the content of my Gruntfile.js: module.exports = function(grunt) { require('load-grunt-tasks')(grunt); grunt.initConfig({ uglify: { start: { files: { 'js/script.min.js': ['js/script.js&a ...

Discover the ins and outs of integrating YAML front matter into your destination directory path

I am looking to customize the path of my blog posts to include a fancy date format like /blog/2013/09/17 so that the links from my previous octopress blog remain intact. Within the YAML front matter on each markdown page, I have included the date informat ...

Error encountered on production server (Ubuntu 14.04.3 LTS) while running Grunt / npm

Encountering an error on the production server (local environment is working fine on both Windows and OSX). /home/myuser/my-app/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js:33 }).flatten().uniq().value(); ^ TypeError: undefined is not ...

Issue with creating source map - trouble with grunt and sass setup

Trying to set up SASS with Grunt and encountering some errors. Ruby, SASS, and Grunt are all installed in the path with the following versions: node: 0.10.20 npm: 1.3.11 grunt-cli: 0.1.13 grunt: 0.4.5 sass: 3.4.4 Package.json: ...

I prefer to have a cache-free experience in my angular application when utilizing a grunt and nodejs server

When serving my Angular web application with Grunt, I am encountering an issue where ajax calls to my Node.js server are not being made. This leads me to believe that my application is using cached data, even though I have not explicitly enabled any cachin ...

What is the best method for having Grunt monitor Compass changes without interrupting an Express server?

I have a good grasp on how to set up grunt to watch for changes in sass files and compile them, as well as starting an express server. However, I'm struggling to find a way to keep the express server running while also watching for changes in the sass ...

Combine the running of the app and the mocking of tests into a single Grunt command within the Gr

I currently have a fully functional Node.js Express REST API application. Great. In addition, I have successfully created a Mocha/Chai/Supertest mock to test the API application mentioned above. Excellent. However, the issue arises when I need to manuall ...

There seems to be an issue with the output of async functions in the node

Currently running version 0.12.7 All default fs functions are failing to execute. An example would be fs.readdir grunt.registerTask('commentTest', function (arg) { var fs = require('fs'); console.log('Outside Test 1'); console.warn('Outside ...

Copy files using grunt, in accordance with the ant pattern, while excluding any variable directories

My task is to transfer files from the src/ folder to the dist/plugin directory. Since the version can potentially change, I would like to exclude the version number in all instances. Here is what I currently have: files[{ cwd: 'src' src ...

Organizing a Flask project for optimized workflow with Grunt

After purchasing an HTML/CSS/Js admin template built on the Bootstrap framework, I found that it met most of my MVP needs. My plan was to customize it slightly and then integrate my backend developed with Flask. Being relatively new to this field, I was i ...

When using a service, AngularJS can experience issues when the code is minified

Hello, I'm still learning AngularJS and trying my best to follow Todd Motto's Opinionated AngularJS Styleguide for Teams. I've encountered an issue while using Grunt to uglify my code - whenever I enable mangling, it throws an error: Error: [$injector:unp ...

How can I implement livereload in CQ5 using Bower?

Recently, I came across a tutorial on YEOMAN for frontend development which was very informative. The livereload feature caught my attention; whenever there is a change in js, css, or html files, the browser automatically reloads to showcase the changes. ...

Should Bower and Grunt Be Installed Globally or Locally?

When it comes to installing packages globally, we typically avoid it due to the possibility of working on multiple projects simultaneously that require different versions of the same libraries. However, there seems to be conflicting information regarding t ...

Automate your transformations with a Gruntfile that includes grunt-contrib-watch, browserify, and hbsfy (handlebars) plugins

I am fairly new to the world of tools like grunt, browserify, and handlebars. I have set up my gruntfile.js to monitor changes in certain .js files and then automatically run the default browserify bundle command on them. Below is a snippet from my current ...

Guide on setting up a personalized express server with grunt, including livereload and node-inspector. Exploring the Yeoman client architecture

I followed the instructions outlined here: What's the purpose of gruntjs server task? In my gruntfile configuration: server: { port: 80, base: yeomanConfig.app } }); Following that, grunt.registerTask('server', &ap ...

The task "grunt-karma.js" is currently being loaded, but unfortunately an error has occurred: SyntaxError - An unexpected identifier was found

Encountering an issue when loading "grunt-karma.js" tasks while all other tasks are loading correctly. This problem started to occur after updating several dependencies, including grunt-karma and karma. Here is the section from my package.json: "grunt-ka ...

Building with NodeJS and Grunt

Just starting out in the NodeJS and Grunt realm, I am tackling a project with dependencies across multiple modules. My main query is: how can I streamline my build process for each individual project/module? Currently, whenever there's an update, I find my ...

Encountered an issue while trying to install npm grunt-libsass

Attempting to set up grunt-libsass by running this command: npm install grunt-libsass --save-dev Resulting in the following error message: npm WARN engine <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7710050219035a1b1e1504 ...

At what point is it ideal to initiate a project?

Imagine my project as an npm package where I use tools like webpack or grunt to bundle my css, js, and img files into a dist directory. The build script is specified in the package.json. When is the best time to execute the build script? Should I do it du ...