0

Sorry to be a pain, I can imagine this question has appeared in the past - but despite trying various different fixes - I'm still not getting anywhere.

So I've set up Node, NPM, Express on my current server based off instructions from this Youtube clip https://www.youtube.com/watch?v=OhPFgqHz68o

I've switched on my node server using node server/index.js

Following this, in a new tab in my terminal I used cd server then npm install which then produced the following: npm WARN package.json MeanApp@1.0.0 No description npm WARN package.json MeanApp@1.0.0 No repository field. npm WARN package.json MeanApp@1.0.0 No README data

I then ran npm install grunt --save-dev, which then produced the following: npm WARN package.json MeanApp@1.0.0 No description npm WARN package.json MeanApp@1.0.0 No repository field. npm WARN package.json MeanApp@1.0.0 No README data grunt@0.4.5 node_modules/grunt ├── which@1.0.9 ├── dateformat@1.0.2-1.2.3 ├── eventemitter2@0.4.14 ├── getobject@0.1.0 ├── rimraf@2.2.8 ├── colors@0.6.2 ├── async@0.1.22 ├── hooker@0.2.3 ├── grunt-legacy-util@0.2.0 ├── exit@0.1.2 ├── nopt@1.0.10 (abbrev@1.0.5) ├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0) ├── lodash@0.9.2 ├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3) ├── coffee-script@1.3.3 ├── underscore.string@2.2.1 ├── iconv-lite@0.2.11 ├── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1) ├── grunt-legacy-log@0.1.1 (underscore.string@2.3.3, lodash@2.4.1) └── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.16)

Following this, I then ran grunt server which produced: 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.

However, I've looked inside my server folder on my computer and it contains grunt, inside node-modules > grunt > lib > grunt.js

Please help, I'm driving myself crazy.

1 Answers1

0

When you run grunt serve Grunt is looking for a file in the root directory called Gruntfile.js, this file is where you write all your Grunt tasks.

The file you found inside node_modules/grunt/lib/grunt.js is actually Grunt itself.

I recommend taking a read of the Getting Started guide that Grunt provides, it'll give you a clear idea of how to get set up correctly with Grunt and how to combine it with your project.

Martyn Davies
  • 1,493
  • 9
  • 12