Installation questions

What is the problem? Please be detailed.
New user here and having no success getting grunt to open a Chrome browser window even though Chrome is an “allowed program” in my Windows Security Settings. When I type “grunt” in a command window I get “unable to find gruntfile”.

Other questions:

  • What is the recommended directory structure (locations, paths) for ODK2? I installed mine on the hard drive (C:\ODK2) and the application designer as a sub-directory under ODK2.

  • Does the sub-directory for the Application Designer have to have the name “app-designer-2.1.0”, or can I rename it simply “AppDesigner”?

  • I installed Android Studio - does that mean I do not need adb? Is it preferable to install Android SDK instead of Android Studio?

What ODK tool and version are you using? And on what device and operating system version?
ODK2
Samsung TabActive2
Windows7

What you have you tried to fix the problem?
Searched for grunt solutions on the ODK forum, the grunt website (getting started), stackoverflow, git and numerous other sites.

Anything else we should know or have? If you have a test form or screenshots or logs, attach here.

Hi Rob!

Great to hear you are starting in on ODK2.

One thing I am going to suggest you start with is some of the initial setup guides as slides we did here:

There are a number of steps, including the ones around installing nodejs and grunt, as well as checking the version, that may help you with your initial problem getting grunt to open a chrome browser (particularly in the 02_ slides).

I think the location/path for ODK2 is pretty flexible – we have stuck the app designer all sorts of places.
We also have definitely renamed the app designer (often with the date of the version or the survey).

You can install either Android studio and then add on SDK packages or SDK directly, directions are in here:
https://docs.opendatakit.org/odk2/app-designer-prereqs/?highlight=sdk#android-sdk
I think you will still need adb, since that is how, say, you get the application on to a tablet.

Hope that helps you progress!

Best,
Caroline

Hello Caroline,

Thanks so much - those slide presentations and your responses to my questions have been super helpful for walking me through the installation process. The one remaining thing is getting grunt to work. The ‘grunt --version’ command returns the version number, but typing ‘grunt’ does not open a Chrome browser window (screen capture below).

It seems to be expecting a gruntfile that has already been created, at least based on the various forums I’ve read and the grunt ‘getting started guide,’ which shows this code (below) for creating such a file. Is this what I need to do next? If so, where do type the code? I tried this in the command (cmd) window but it doesn’t recognize ‘module.exports’.

I’d be grateful for any ideas you have to get over this last hurdle,

Rob

Dear Rob,

I think if all the rest of the installing steps were successful, you should not have to create the grunt files; they should come with the app designer folder. Not quite sure why you are seeing the error when the version shows up. Have you re-tried
npm install -g grunt-cli
and did it give you any error messages?

Best,
Caroline

Hi again, Caroline –

Thanks for the quick reply! That command (npm install -g grunt-cli) seems to install correctly, although when I run it from my AppDesigner folder there’s a warning about the path in Roaming (first screen shot below). So, I also ran the command in C:\Users…\Roaming which also installed correctly and without those warnings (second screen shot). However, running the grunt command from each location produces an error message, one asking for a gruntfile, the other looking for a local version of grunt.

I’ve run the “npm install -g grunt-cli” several times over the last couple days, so just now I tried uninstalling and reinstalling grunt, but I still get an error.

Any other ideas?

I sure appreciate your help,

Rob

Dear Rob,

So possibly should have thought of this sooner (and maybe you already checked this), but let’s take the message very literally. Have you checked that Gruntfile.js is in the AppDesigner folder? It comes with the app-designer-2.1.0 folder, and should just be right within it.

Best,
Caroline

Caroline,

Good idea! There is not a gruntfile.js in my AppDesigner directory, but several of them in subdirectories of the node_module subdirectory, so I copied one of them to my AppDesigner directory and received the message in the screen capture below – are we getting closer? I tried installing that npm module referred to in the message (grunt-contrib-nodeunit) and it did install it somewhere but I get the same error message as below with entering the grunt command.

Rob

Dear Rob,

Definite progress! So I am thinking maybe your download of app-designer-2.1.0 went wrong, because when you download it, there should have been the Gruntfile.js on the upper level AND a whole lot of other stuff (including node_modules… but their gruntfiles are not going to be interchangeable…) that were in it. See this pic of my fresh download, where Gruntifle.js is right there in app-designer-2.1.0:

It is sounding like for you stuff got lost along the technology way…

So I would suggest you re-download app designer. First, I would suggest you just try to use the default one, and then if that works, add your files to it. Hopefully that will solve your problems! Let us know how it goes.

Best,
Caroline

Caroline,

Voila! Reinstalling the Application Designer did the trick (this time the extract included gruntfile.js). Not sure if the file extraction got messed up before, or if I accidentally deleted it. Anyway, thank you a ton for your patience in walking me through this process. Can’t wait to start designing some forms now!

Rob

A post was split to a new topic: Installing and issue with gruntfile