FAQ Database Discussion Community


Strange npm behavior when installing packages like grunt

node.js,gruntjs,npm,gulp,bower
I run the following command in my bash and I get the related results: [email protected]:~$ sudo npm install -g grunt-cli /usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt [email protected] /usr/local/lib/node_modules/grunt-cli ├── [email protected] ├── [email protected] ([email protected]) └── [email protected] ([email protected], [email protected]) and [email protected]:~$ grunt /usr/bin/env: node: No such file or directory I also have try to install...

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 start Node Server and then open browser

javascript,node.js,gruntjs,connect
I have grunt task that starts the server: module.exports = function(grunt){ grunt.registerMultiTask('connect', 'Run a simple Node Server', function(){ var options = this.options(); // Tell Grunt this task is asynchronous. var done = this.async(); var server = connect(); server.use(function(request, response, nxt){ ... }); server.listen(port); }); }; Now I want to use...

Grunt tasks running indefinitely

javascript,node.js,gruntjs,grunt-contrib-imagemin
I have installed grunt and trying the grunt-react and grunt-contrib-imagemin tasks. I have setup the following Gruntfile.js. module.exports = function(grunt) { grunt.initConfig ({ imagemin: { dynamic: { files: [{ expand: true, cwd: 'public', src: ['development/images/*.{png,jpg,gif}'], dest: 'images' }], options: { cache: false } } }, react: { single_file_output: { files:...

Organize multi-app project with share code

git,github,gruntjs,openui5,sapui
I have a serious problem (!!!) about organizing my develop environment; I have two apps: app1 and app2. This apps are written using OpenUI5 (but this detail is not important) app1 and app2 are similar and share some code (for example the code to login). I use git (with git-flow)...

Combine js files from different directories via config using grunt

javascript,gruntjs,npm,minify
I'm using grunt and sass and I'm looking for a sass-like feature to import any JS file I like to and combine them to 1 file via some config depending on the directory I am in. Example directories: startpage file1.js file2.js importjs.json page1 file3.js file4.js importjs.json global global1.js global2.js Each...

Grunt filerev, usemin and file caching

angularjs,caching,gruntjs,grunt-usemin
I'm using grunt filerev task to add cachebusters to files when their content changes. usemin task to replace the relevant file path with their revved versions where they are referred. Everything is setup well and they are working as expected / written in their documentation. I'll try to explain the...

Grunt inject CSS file into