Getting grunt command not working - node.js

All the npm installs gave errors and warnings but would say "Everything is ok" at the end.
When I tried grunt serve, I got these warnings.
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-htmlmin" not found. Is it installed?
>> Local Npm module "grunt-contrib-cssmin" not found. Is it installed?
>> Local Npm module "grunt-contrib-uglify" not found. Is it installed?
>> Local Npm module "grunt-bower-requirejs" not found. Is it installed?
>> Local Npm module "grunt-eslint" not found. Is it installed?
>> Local Npm module "grunt-jscs" not found. Is it installed?
How do I fix it?

Are you installing on a Mac or Windows?
First, make sure the Grunt Client is installed within your directory:
$ npm install -g grunt-cli
Then:
$ npm install grunt-serve
Further documentation of installation can be found here:
https://www.npmjs.org/package/grunt-serve

Try as below:
1) npm install -g grunt-cli
This will put the grunt command in your system path, allowing it to be run from any directory.
Note that installing grunt-cli does not install the Grunt task runner! The job of the Grunt CLI is simple: run the version of Grunt which has been installed next to a Gruntfile. This allows multiple versions of Grunt to be installed on the same machine simultaneously.
2) npm install grunt --save-dev
3) npm install grunt-serve
The easiest way to add Grunt and gruntplugins to an existing package.json is with the command npm install --save-dev. Not only will this install locally, but it will automatically be added to the devDependencies section, using a tilde version range.
for further assistance follow this link
http://gruntjs.com/getting-started

Related

How to resolve this gulp watch issue [duplicate]

I am trying to start my angular app using grunt serve command
but I am getting Fatal error: spawn cmd ENOENT.
I used following commands to generate my Angular App
npm install -g yo grunt-cli bower
npm install -g generator-angular
yo angular
npm install
bower install
then i used grunt serve command to start my app
but its not working.
System Info:
OS: Windows 7 64 bit
npm version : 2.11.3
please help me, I gone through all the grunt documentation but no clue.
Try the following possible solutions:
Verify the npm folder exists at the following location C:\Users\My-UserName\AppData\Roaming\npm
Try to run npm cache clean
Add C:\Windows\System32\ to the PATH Environment variable
Run grunt serve with cmd.exe instead of git bash. I have the same problem and have dealt with it in this way.

Gulp not recognized in command prompt despite updated added path variable

I installed gulp following the standard procedure:
$ npm install --global gulp-cli
adding the project dev dependency
$ npm install --save-dev gulp
and a gulpfile.js
When running gulp from Git Bash I get the error gulp: command not found
I followed related threads here on SO updating my path variable (Windows 7) with C:\Users\username\AppData\Roaming\npm to no avail
I actually didn't find any gulp folders inside C:\Users\username\AppData\Roaming\npm (other packages are still there and function as expected). Instead, gulp seems to get installed to C:\Program Files\Git\usr\local
Running npm root and npm root -g respectively, return
C:\Users\username\node_modules and
C:\Program Files\Git\usr\local\node_modules
I also got the following warnings when running npm install --save-dev gulp
I feel like I mixed up paths somehow, but I'm a bit lost, as I'm new to Node and Gulp.
After open command shell with administrator simply write npm install -g gulp and npm install -g gulp-cli. You can reach from every location to gulp then.

npm install from package.json, the dependancy -v yields command not found

Reinstalled node/npm from scratch and after npm install I can see the node_modules folder with all of the content from package.json. Checking gulp -v gives command not found in the command line on a mac. If I install gulp globally, gulp -v yields the version.
Is there a way of not installing all dependancies globally to use?
Generally gulp is a package which is used to run some task. These task might need to have administrator privileges. So it is better to install it globally using "npm install -g gulp" command. Here -g means "install it globally".
npm install installs the package locally.

local npm module "grunt-prettify" not found. is it installed?

I install Node Js and then Grunt. When i run Grunt Copy command, cmd shows these errors:
local npm module "grunt-prettify" not found. is it installed?
local npm module "grunt-autoprifixer" not found. is it installed?
local npm module "grunt-contrib-cssmin" not found. is it installed?
local npm module "grunt-contrib-uglify" not found. is it installed?
Can any one tell me how to get rid of these messages. Thanks in advance!
You need to run npm install grunt-prettify grunt-autoprifixer grunt-contrib-cssmin grunt-contrib-uglify

Grunt is not recognised : windows7 64-bit

I have installed npm and installed grunt, but when i run grunt, it says 'grunt' is not recognized as an internal or external command.
I done the below steps in command prompt
npm install
npm install -g grunt-cli
PATH variable and grunt folder are available but still i am not able to run grunt.
Please provide me a solution for this
You have only installed the command line interface.
Use npm install -g grunt to install the actual program.

Resources