1

There's a question with almost the same title as mine with no answers here, and I can't comment to see if @Gabriel-Kunkel got anywhere with it. I was going to post an answer, but I saw StackOverflow said to avoid doing that, so asking the same question was the best I could think to do...

I'm trying to get a fresh install from the generator-angular-fullstack with these options

  1. Grunt
  2. Jasmine
  3. TypeScript
  4. HTML
  5. LESS
  6. ui-router
  7. Bootstrap
  8. UI-Bootstrap
  9. Mongo
  10. Authentication Boilerplate (Yes)
  11. No other oAuth strategies
  12. Socket.io (Yes)

The generator, before changing/adding anything, loads a blank screen with these error holding it up in the Chrome console:

Uncaught Error: [$injector:nomod] Module 'intranetApp.auth' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

And also the same thing with 'intranetApp.admin'

Does anyone know what I can do to fix this?

Community
  • 1
  • 1
ZachO
  • 68
  • 9
  • You're missing some modules, check if you have this file generated based on this template : https://github.com/angular-fullstack/generator-angular-fullstack/blob/master/app/templates/client/components/auth(auth)/auth.module.js – topheman Feb 15 '16 at 22:46
  • @topheman - Let me know if this isn't a decisive enough way to verify this (and how I should go about confirming that if so), but I have in my app.js file the module intranetApp, with dependencies on intranetApp.auth and intranetApp.admin (and others, but they're all found). intranetApp.admin is declared in intranet/client/app/admin/admin.router.js intranetApp.auth is declared in client/app/components/auth/auth.module.js Is there some place I should check to confirm that those files are being included when the modules are inserted? – ZachO Feb 16 '16 at 14:17
  • I tried the generator with the same configuration as above _except_ I chose Babel instead of TypeScript (#3 in my list above, but the first question the generator asks) and it worked fine. I think I may just be a noob and didn't put together that TypeScript is a compiled language, so I never installed the compiler with `npm install -g typescript` – ZachO Feb 16 '16 at 14:27
  • Never mind... I tried the original configuration again, then installed typescript with npm and got the same problems. – ZachO Feb 16 '16 at 14:42
  • Before running that kind of generator, please choose between typescript, es6 and es5, those aren't the same languages. You should start learning about JavaScript (turn to npm / bower / grunt / transpilers after). There's nothing bad beeing a noob, just don't try to fly before you can walk ;-) – topheman Feb 16 '16 at 18:47
  • My problem wasn't necessarily regarding understanding JavaScript, but more so that I haven't kept up as well as I thought with newer tools like Babel (until trying out the newest angular-fullstack generator, I had never heard of it). I had originally used the same generator to create an intranet application for a small engineering company, but almost two years ago now. The version I used didn't have an option for Babel or TypeScript - only (I believe) JavaScript was used. In updating node modules, I broke the code, so my intent was to use the latest generator and manually re-add my code. – ZachO Feb 17 '16 at 19:51

1 Answers1

0

TL;DR

Inside your Gruntfile.js, you need to replace var module = /\.module\.js$/; with var module = /[\w/]+.module.ts$/; (Line 632 as of commit#24f1fc1 of the generator)

/TL;DR

So this took a while and brought me to quite a few pages, but I'll try my best to give credit where it's due.

First, I noticed from an identical question to mine, @gabriel-kunkel pointed out there were some missing peer dependencies which I installed (not sure if you should add --save or --save-dev to these commands, but I used --save-dev):

  1. npm install tslint
  2. npm install kerberos
  3. npm install typescript

You may have others though, so look in your console output at the bottom of the dependency tree.

Second, I saw I got an error regarding xcode-select when running npm install and to fix that, I found here that I needed to install xcode from the Apple App Store. I installed the latest non-beta version at the time, which was v7.2.1 and then entered sudo xcode-select -s /Applications/Xcode.app/Contents/Developer into the console (as the link says, your path may be different - mine wasn't).

Third and lastly, I stumbled here which stated exactly what I needed to do to fix my problem. Gruntfile.js needed one line to be changed... a quote from fdfandrade from that link:

Replacing this "var module = /.module.js$/;" by this "var module = /[\w/]+.module.ts$/;" in my Gruntfile.js worked for me!

For me, it was line 632. Hope this helps someone else from going insane trying to figure this out.

Community
  • 1
  • 1
ZachO
  • 68
  • 9