I get the following when i try to use grunt, yo, bower ect
no error just next line ive installed every dependancy i can think of so i dunno what else to check
below is from my terminal
Any ideas
justin#justinComputer:~/Documents/gitRepos/gitRepo2$ cd learningAngular/
justin#justinComputer:~/Documents/gitRepos/gitRepo2/learningAngular$ grunt serve
justin#justinComputer:~/Documents/gitRepos/gitRepo2/learningAngular$ grunt serve
justin#justinComputer:~/Documents/gitRepos/gitRepo2/learningAngular$ grunt serve
justin#justinComputer:~/Documents/gitRepos/gitRepo2/learningAngula
Try running npm install inside your learningAngular directory. And then grunt serve.
Related
I am trying to set grunt for my node.js project and I have followed below steps:
1)I have installed node.js and it is working fine.
2)Installed git.
3)Installed grun by running: npm install -g grunt-cli.
C:\Users\user\Downloads\bpost-gs-api-1.1.1>npm install -g grunt-cli
C:\Users\user\AppData\Roaming\npm\grunt -> C:\Users\891153\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt
C:\Users\user\AppData\Roaming\npm
`-- grunt-cli#1.2.0
Now I have run the cmd grunt -version, I got below error:
grunt is not recognized as an internal or external command,
operable program or batch file.
Can you please help me to set up grunt for my project. How to setup variable env and how to setup path etc.
Appreciate your help
https://gruntjs.com/getting-started
In order to get started, you'll want to install Grunt's command line interface (CLI) globally. You may need to use sudo (for OSX, *nix, BSD etc) or run your command shell as Administrator (for Windows) to do this.
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.
start from reading this:
https://gruntjs.com/installing-grunt
If you need a specific version of Grunt or a Grunt plugin, run npm install grunt#VERSION --save-dev where VERSION is the version you need.
for better understood on how to start setup a grunt project: https://gruntjs.com/getting-started#preparing-a-new-grunt-project
A typical setup will involve adding two files to your project: package.json and the Gruntfile.
package.json: This file is used by npm to store metadata for projects published as npm modules. You will list grunt and the Grunt plugins your project needs as devDependencies in this file.
Gruntfile: This file is named Gruntfile.js or Gruntfile.coffee and is used to configure or define tasks and load Grunt plugins. When this documentation mentions a Gruntfile it is talking about a file, which is either a Gruntfile.js or a Gruntfile.coffee.
I have followed this link to try to install a mean.js stack on an ubuntu server.
Regarding grunt, in /opt/mean, I have done
sudo npm install -g bower grunt-cli
sudo npm install grunt --save-dev
sudo npm install
However, grunt or grunt jshint inside the folder gives
A valid Gruntfile could not be found. Please see the getting started
guide for more information on how to configure grunt:
http://gruntjs.com/getting-started
Fatal error: Unable to find Gruntfile.
Note that npm start works, and http://server_domain_or_IP:3000 can display the sample application.
Does anyone know how to fix the grunt error?
As the error states, you do not have a Gruntfile and https://gruntjs.com/getting-started shows you an example of one.
Simply installing Grunt is not enough. When you run grunt it needs a configuration file (your Gruntfile) to run any tasks. The Gruntfile itself contains the tasks to be run.
You will need a Gruntfile.js in your project. you can create the same using the following grunt command.
grunt-init gruntfile
The above command will create the sample gruntfile.js file in your project.
I've been trying to install Semantic UI with npm. The website says to run the following code:
npm install -g gulp
npm install semantic-ui --save
cd semantic/
gulp build
Gulp seems to install correctly, as does Semantic UI. But when I run the last line, I get
No gulpfile found
I'm not sure what this could be from. Do I need to make a file before I run this command?
Thanks!
Run gulp build from inside of /semantic (not root)
Gulp is looking for a gulpfile in the same directory where the command is executed.
So, cd into the semantic directory and try running gulp build again. It should work as long as you see a gulpfile.js file and have followed all the steps from the Gulp quick start.
I'm trying to run grunt but receiving this error. I have grunt installed globally and can run 'grunt watch' from other locations and it works for other files. I have a new project given to me which has less files, and it contains a package.json file (this seems buried, where I'd assume it should be closer to the root but I'm new to this). I try to run grunt watch from the root and receive the error message above. The package.json does not list grunt files as dependencies. Any help is appreciated. Thanks
The error is telling you that it's missing locally. npm scripts run things out of the node_modules directory, so install grunt locally to resolve it.
npm install grunt --save-dev
I wonder if it's possible to run grunt 0.4.* without having installed grunt-cli.
I understand that grunt-cli looks for the version of grunt installed in node-modules in my project directory in order to run that version of grunt but...is it possible to run grunt without having grunt-cli installed? How?
Thanks in advance!
The grunt-cli is a very small amount of code. If I was you I would look through it in the GitHub repository. That way you will learn what it does, and it's very easy to do the same.
I have had luck with running it with no grunt-cli. You can do it with the following command:
node -e "require('grunt').cli()"
If you want to specify tasks you can do it like this:
node -e "var g = require('grunt'); g.cli.tasks = ['default']; g.cli()"
try
node -e "require('grunt').cli();"
if you're on a mac / unix
You can try from some other script:
var grunt = require('grunt');
grunt.cli();
That will look for the grunt package and execute the Gruntfile.js.