Picture of Julia Rietveld
Can't install grunt
by Julia Rietveld - Tuesday, 27 January 2015, 2:35 PM
 

Hi, smart people of Adapt, 

Please help me pass the installation process so I can start enjoying your wonderful framework.

1. I deleted all old node modules on my Mac and installed a fresh new node.js and npm.

2. I installed sudo npm adapt and grunt-cli.

3. I answered all questions after typing in adapt create course. And this is what I get from my terminal:


quiz1 has been created.

To build the course, run:
cd quiz1
grunt build

Then to view the course, run:
grunt server

Julias-MBP:quiz juliarietveld$ cd quiz1
Julias-MBP:quiz1 juliarietveld$ grunt build
grunt-cli: The grunt command line interface. (v0.1.13)

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
Julias-MBP:quiz1 juliarietveld$ npm install grunt
grunt@0.4.5 node_modules/grunt
├── which@1.0.8
├── 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
├── coffee-script@1.3.3
├── underscore.string@2.2.1
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)
├── iconv-lite@0.2.11
├── findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)
├── 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)
Julias-MBP:quiz1 juliarietveld$ grunt build
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'matchdep'
Warning: Task "build" not found. Use --force to continue.

Aborted due to warnings.
Julias-MBP:quiz1 juliarietveld$ npm install grunt-cli
npm WARN prefer global grunt-cli@0.1.13 should be installed with -g
grunt-cli@0.1.13 node_modules/grunt-cli
├── resolve@0.3.1
├── nopt@1.0.10 (abbrev@1.0.5)
└── findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)
Julias-MBP:quiz1 juliarietveld$ grunt -v
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'matchdep'
>> at Function.Module._resolveFilename (module.js:338:15)
>> at Function.Module._load (module.js:280:25)
>> at Module.require (module.js:364:17)
>> at require (module.js:380:17)
>> at Object.module.exports (/Users/juliarietveld/Documents/MMRIA13/eLearning/adapt/quiz/quiz1/Gruntfile.js:2:5)
>> at loadTask (/Users/juliarietveld/Documents/MMRIA13/eLearning/adapt/quiz/quiz1/node_modules/grunt/lib/grunt/task.js:325:10)
>> at Task.task.init (/Users/juliarietveld/Documents/MMRIA13/eLearning/adapt/quiz/quiz1/node_modules/grunt/lib/grunt/task.js:437:5)
>> at Object.grunt.tasks (/Users/juliarietveld/Documents/MMRIA13/eLearning/adapt/quiz/quiz1/node_modules/grunt/lib/grunt.js:120:8)
>> at Object.module.exports [as cli] (/Users/juliarietveld/Documents/MMRIA13/eLearning/adapt/quiz/quiz1/node_modules/grunt/lib/grunt/cli.js:38:9)
>> at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:45:20)

No tasks specified, running default tasks.
Running tasks: default
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.
Julias-MBP:quiz1 juliarietveld$

4. I'm lost. Please help! Thank you so much!

Julia

Picture of Julia Rietveld
Re: Can't install grunt
by Julia Rietveld - Tuesday, 27 January 2015, 4:17 PM
 

So, I've installed npm install matchdep.

The next errors:

Julias-MBP:quiz1 juliarietveld$ sudo npm install matchdep
Password:
matchdep@0.3.0 node_modules/matchdep
├── stack-trace@0.0.7
├── resolve@0.5.1
├── globule@0.1.0 (lodash@1.0.1, minimatch@0.2.14, glob@3.1.21)
└── findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)
Julias-MBP:quiz1 juliarietveld$ grunt build
>> Local Npm module "grunt-bower-requirejs" not found. Is it installed?
>> Local Npm module "grunt-concurrent" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-handlebars" not found. Is it installed?
>> Local Npm module "grunt-contrib-less" not found. Is it installed?
>> Local Npm module "grunt-contrib-requirejs" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-jsonlint" not found. Is it installed?
>> Local Npm module "grunt-open" not found. Is it installed?
>> Local Npm module "grunt-requirejs-bundle" not found. Is it installed?
** Using theme adapt-contrib-vanilla
** Using menu adapt-contrib-boxMenu
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "adapt-grunt-tracking-ids" not found. Is it installed?
>> Local Npm module "grunt-jsonlint" not found. Is it installed?
Warning: Task "jsonlint" not found. Use --force to continue.

Aborted due to warnings.
Julias-MBP:quiz1 juliarietveld$

 

At this point I just want to cry. Help anyone?

Picture of Matt Leathes
Re: Can't install grunt
by Matt Leathes - Tuesday, 27 January 2015, 5:12 PM
 

if you just run

$ npm install

it should install everything you need at the same time

I'm not sure why this should be necessary though, it didn't used to be. Just trying to find out if this is something we've accidentally changed in an update.

Picture of Matt Leathes
Re: Can't install grunt
by Matt Leathes - Tuesday, 27 January 2015, 4:19 PM
 

did you originally install grunt globally? i.e. via:

$ sudo npm install grunt-cli -g

the '-g' part being the important bit...

If you did, then I wonder if perhaps a step is missing from the documentation. If you just do

$ npm install

In the 'quiz1' folder, does that do anything?

Picture of Julia Rietveld
Re: Can't install grunt
by Julia Rietveld - Wednesday, 28 January 2015, 9:04 AM
 

God morning Matt,

Thank you for your fast replay. And it did help! It's working!

What I did so far was the following (maybe it can help someone later). I'm on a Mac and don't have admin rights.

1. $ sudo npm install adapt-cli -g

2. $ sudo npm install grunt-cli -g

3. cd path/to/myfolder

4. adapt create course (my answers were: 'course', 'quiz1', just pressed return, 'y')

5. grunt build gave me an error "can't find local gruntfile.js". I had to cd one level lower to quiz1, of course.
6.  In my root folder ’grunt build’ gave me an error ’Unable to find local grunt’.
7. I replied ’sudo npm install grunt’. It did, so I went ’grunt build’.
8. And got back ’Cannot find module matchdep’.
9. I said back ’sudo npm install matchdep’. He liked it.
10. So I tried again ’grunt build’ and got back a whole list of ’Local NPM module ”grunt- …..” not found’ (all 14 of them).
11. You suggested to fight back with ’sudo npm install’ in my root folder, where I was from step 6 and it worked!
 
I hope this human log helps others to get in.
 
Good luck,
Julia
Picture of Tom Taylor
Re: Can't install grunt
by Tom Taylor - Thursday, 29 January 2015, 11:15 AM
 

Hiya Julia, 

It sounds like something went wrong with the Adapt cli's install process. We've found that it can sometimes fail during the 'npm install' stage, meaning that none of the required node modules are installed, hence ’Unable to find local grunt’ etc.

If you do get this error, it's probably a case of manually running 'npm install' from the folder that contains the package.json (as Matt suggested).

We're looking into fixing this (or at the very least getting the Adapt cli to print out some useful errors if something does go wrong).