Yeoman and GruntJS issues - gruntjs

on command terminal to using
npm install -g yo
it's getting error;
"npm WARN deprecated this package has been reintegrated into npm and
is now out of date with respect to npm
Found potential issues on your machine :("
What should i have to do to fix it ?

Related

Solutions to solve "zsh: command not found: grunt" not working

Trying to run grunt in my command line, but I am getting zsh: command not found: grunt.
In my project directory, I ran npm install -g grunt-cli, as per the grunt documentation. I've tried running npm install and npm install grunt --save-dev. I still get the same result.
Options I've tried:
adding grunt to zsh as a plugin
adding /usr/local/share/npm/bin/ to $PATH, as specified here
the solutions in this article on Hongkiat ("Solving Grunt “Command Not Found” Error in Terminal [Quickfix]"). There is a command here that is deprecated.
trying sudo npm install -g grunt-cli
None of these are working. Any tips on how to get grunt to work?
My system:
Mac OS v10.11
npm v5.6.0
node v8.9.4
zsh 5.0.8
Have you tried creating a .zshrc file and other files necessary to set the zsh paths on your mac?

Grunt command line is not working

When I try to run
$ grunt
it showing this error
Fatal error: unable to find local grunt
I have installed grunt in my project by using this command
npm install -g grunt-cli
can any one tell me what I have done wrong?
Try to use sudo as sometimes it is just because of access-permission issues. Also check if you are running the command in your project's root directory.
so try
sudo npm install -g grunt-cli
it might also be a good idea to update your update existing npm before installing grunt-cli by running
npm update -g npm

Unable to install Grunt ?

I've installed grunt :
sudo npm install -g grunt-cli
/Users/user/.nvm/versions/node/v4.3.0/bin/grunt -> /Users/user/.nvm/versions/node/v4.3.0/lib/node_modules/grunt-cli/bin/grunt
/Users/user/.nvm/versions/node/v4.3.0/lib
└── grunt-cli#1.2.0
But when i run grunt i have errors:
grunt
grunt-cli: The grunt command line interface (v1.2.0)
Fatal error: Unable to find local grunt.
If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:
http://gruntjs.com/getting-started
Where i am wrong please ?
you have to install grunt globally and locally
you have installed the cli globally with the -g flag
now you have to install it locally in your package.json with ...
npm install -SD grunt
then your "grunt" command will work - assuming you have a valid gruntfile
This looks like a duplicate of Fatal error: Unable to find local grunt.
In a nutshell, try running grunt:init or npm:init first (depending on the version you have. See linked question for more details.
install the command-line interface:
npm install -g grunt-cli
install the local task runner:
cd [my project root]
npm install grunt --save-dev
define your Gruntfile.js as per http://gruntjs.com/getting-started#the-gruntfile
run the tasks with: grunt

npm semver version invalid issue with grunt installation

While installing grunt, one of the errors is unmet dependency semver#4
i am using node#0.10.33, npm#1.4.28
i run two commands and it shows two versions and one is invalid
npm list -g
and in the tree it shows semver#2.3.0 invalid
now i run
npm view semver version
now it shows 4.1.0
i tried npm update semver
but nothing happens
i have even tried to the solution provided in similar question npm error invalid semver
curl https://npmjs.org/install.sh | sh
but donesnt help
I am new to npm and grunt please help!
what do you mean by While installing grunt?
Installing the grunt-cli tools or the grunt-runner in your project?
since 4.0 grunt is split into 2 modules:
grunt-cli
grunt
grunt-cli needs to be installed globally, and only 1 time:
$ npm install grunt-cli -g
grunt needs to be installed locally in every project where you want to use grunt and grunt-plugins:
$ npm install grunt
updating npm:
the crazy stuff about npm is, that you can even update npm via npm:
$ npm update npm -g
the current npm version is 2.1.9, so maybe this solves your problem.
hint: use nvm vor node.js version management. this solves multiple problems:
easy version switching
you don't need sudo for global packages

"Fatal error: Unable to find local grunt." on Windows 7

I cannot get grunt to work at all on Windows 7. Following the instructions on the Grunt website (http://gruntjs.com/getting-started) I've run:
npm uninstall -g grunt-cli
npm uninstall grunt
npm uninstall -g grunt-init
git clone git#github.com:gruntjs/grunt-init-jquery.git c:/Users/me/.grunt-init/jquery
npm install -g grunt-cli
grunt-init jquery
npm install .
After that, running "grunt" produces the following output:
grunt-cli: The grunt command line interface. (v0.1.9)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
The output of npm list grunt is:
npm WARN package.json consolidate#0.9.1 No repository field.
npm WARN package.json jquery-plugin#0.0.0-ignored No repository field.
npm WARN package.json passport-local-examples-login#0.0.0 No repository field.
npm WARN package.json receiptly#0.0.1 No repository field.
npm WARN package.json cookie-signature#1.0.1 No repository field.
npm WARN package.json fresh#0.1.0 No repository field.
npm WARN package.json methods#0.0.1 No repository field.
npm WARN package.json range-parser#0.0.4 No repository field.
npm WARN package.json send#0.1.0 No repository field.
npm WARN package.json pause#0.0.1 No repository field.
npm WARN package.json policyfile#0.0.4 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json eyes#0.1.8 No repository field.
npm WARN package.json bytes#0.2.0 No repository field.
npm WARN package.json dateformat#1.0.2-1.2.3 No repository field.
npm WARN package.json uid2#0.0.2 No repository field.
C:\Users\me\AppData\Roaming\npm
└─┬ grunt-init#0.2.1
└── grunt#0.4.1
Running "npm install grunt" in the current directory gives the same error when running grunt.
Any thoughts? My understanding is that grunt-cli is meant to look for a local grunt install, but I can't work out why it can't find it.
I know its been 2 years since this question was asked. However if someone wants in future:
I got the exact same issue. And I got this fixed by installing grunt locally. As per grunt site,
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.
So I just got it working by installing Grunt locally.
npm install grunt --save-dev
--save : adds it to your package.json.
-dev: adds it as a dev dependency.
There must be a Gruntfile.js located in the directory you run the command from. Also double check that 'npm install grunt' actually gave you a node_modules directory with a sub directory called grunt.
You should install grunt in GUI mode.
Open node.js cmd prompt then open the root folder and run the below commands
npm install ( once it done you can able to see node_modules folder in the root folder)
npm install –g grunt-cli (change the version from ("version": "minified" to Current release("version":"1.11"); you should replace with minified once you run build)
grunt build:full
Note: Version has to change when running grunt very first time.
if the above answer do not works then you can try by using this
rm -rf node_modules/ && npm cache clean && npm install

Resources