So, I generated a fresh angular-fullstack with TypeScript, MongoDB, Bootstrap, Bootstrap UI, Authentication Boilerplate, Twitter and Google OAuth, Grunt, Jasmine, HTML, CSS, and UI-Router for the settings.
After I ran npm install and bower install. There were some unmet dependencies, so I installed
TypeScript, locally
Mocha, locally
Tslint, locally
Also, I was getting an error during build that was resolved by installing
grunt-babel#5.0.0, locally.
Now, when I run "grunt serve" It all works just fine, except when I go to the Admin page at http://localhost:9000/admin. There is no list of users. Instead it says, "The delete user and user index api routes are restricted to users with the 'admin' role." All of the links on the navigation bar are dead, except for the app title.
When I check the console I get these two errors:
Uncaught Error: [$injector:nomod] Module
'perfectAlgorithmDrillsApp.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.
Uncaught Error: [$injector:nomod] Module
'perfectAlgorithmDrillsApp.admin' 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.
I triple-checked. They are not misspelled and they are correctly included in the list of module dependencies.
Further errors arise because the module isn't loaded. Obviously, it can't find the controllers, since those modules aren't loaded.
At this point, I have not added or changed any code.
I've tried a couple things to resolve the situation:
updating yo and angular-fullstack and then recreating the project from scratch.
wrapping those "missing" modules in IFFE's.
I updated node.js to the latest LTS version
More Details:
I am running everything on OSX El Capitan 10.11.2
I'm running node version 4.2.6, npm version 2.14.12, yeoman 1.6.0
in the yo.rc file it says the generator version is "3.3.0-beta.0"
I have mongod running.
I'm doing my work in WebStorm, but I haven't used anything that's built in. It's all been command line.
The TypeScript is being compiled correctly, as the .tmp directory looks good.
I made sure grunt-cli is installed.
Thanks so much for the help. Let me know if you need any more details.
I too had this exact problem. The long answer (plus some other answers to questions you might not be asking for yet or possibly ever) is here, but in short, replace var module = /\.module\.js$/; with var module = /[\w/]+.module.ts$/; inside Gruntfile.js.
If that doesn't work, try going here to see the whole thread on this issue.
Related
I am working on a react app with a couple of colleagues, and after the latest pull I am no longer able to compile the app, but my colleagues are not having any issues.
On my end the app fails to compile because some #material-ui components are displayed as missing in the node_modules/#material-ui directory. However, when I search the folder, I see the files there, they are just shown in typescript format instead of js. However, when comparing my working directory with a colleague's it appears there are also files completely missing on my end that exists on theirs.
For example, when the app fails to compile I see this:
Failed to Compile
./node_modules/#material-ui/core/TextField/TextField.js
Module not found: Can't resolve '../FilledInput' in
'..../node_modules/#material-ui/core/TextField'
When I search this folder, the file is there but labelled 'FilledInput.d.ts'.
Has anyone encountered something like this? I have recompiled the app, and deleted the branch and recloned from remote but the issue remains.
Thanks
Have you tried removing node_modules and installing dependencies again?
Does npm install give any peer dependency warnings? Does this help?
npm i #material-ui/core --save
I have used ngMaterialDatePicker which works fine in dev mode but when I tried to run using gulp serve:dist I am getting the below mentioned error can anyone tell me why it has a strange behaviour like this:
Error:
Module 'ngMaterialDatePicker' 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.
Probably the problem is in uglyfing js code, do you use ng-annotate or babel plugin for build command?
I'm working on an angular app that uses bower for dependency management. At the moment I'm getting the following error in my browser console:
Uncaught TypeError: angular.module(...).info is not a function
From researching this a bit, it seems that I likely have two different versions of angular in use and that's the cause of the error. However, I've used bower list and it looks like angular and all of the packages that list angular as a dependency are using the same version: 1.4.14
In the bower.json file, angular is listed as: "angular": "~1.4.9" under both dependencies and resolutions.
How can I track down where another version of angular is being used? Or could there be something else causing this issue?
Note: this app runs fine on another computer, which is why I'm convinced it's a version issue.
I am currently using the angularbknd-sdk in my Ionic 1 mobile app.
I installed it with Bower, I loaded it as a npm module thanks to browserify-shym:
package.json
"backand": "./bower_components/angularbknd-sdk/dist/backand.min.js"
then I injected the 'backand' module as a dependency of my app :
app.js
require('backand');
angular.module('myApp', ['backand'])
This works like a charm.
But now I would like to use the new Backand angular-sdk, and load it from NPM instead of Bower.
This is what I did :
I removed angularbknd-sdk from bower, from my package.json and the require('backand') line from my app.js.
Then,
I did :
$ npm i -S #backand/angular1-sdk
and I put this line in my app.js :
require('#backand/angular1-sdk');
But when I run my app, I got this error in the javascript console :
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.3/$injector/modulerr?p0=app&p1=Error%3A%20%…%2Fandroid_asset%2Fwww%2Flib%2Fionic%2Fjs%2Fionic.bundle.min.js%3A54%3A463)
What am I doing wrong ?
Thanks in advance.
Without more detail on the exact line that is failing it is hard to tell exactly what is not functioning properly, but this looks like it is missing an ionic include. I would check to make sure you have no occurrences of the Ionic JavaScript SDK in your vendor folder, and that the existing SDK has no files remaining in your project - it is possible that there is an include conflict if the physical javascript files for the old angular1bknd-sdk were not removed from the vendor folder managed by bower.
I'm just trying to run mean.js using grunt. Just did the installation steps in http://meanjs.org. But when loaded in localhost, console is showing error
Uncaught ReferenceError: angular is not defined
Can any one help how to resolve this problem?
It sounds like angular is not included on the page.
When the install process is over, npm will initiate a bower install command to install all the front-end modules needed (including angular) for the application
You can run bower manually using
bower install --config.interactive=false
make sure that angular appears in the public/lib folder and included on the page.