Node_modules failing to load


When trying to simply use any node_modules by adding the directive I get a failure:

SCRIPT5022: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:modulerr] Failed to instantiate module chart.js due to:
Error: [$injector:nomod] Module ‘chart.js’ 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.$injector/nomod?p0=chart.js

Here is the basic code:


angular.module('app', ['ionic', 'chart.js', 'app.controllers', 'app.routes', 'app.directives',''])`

    .config(function($ionicConfigProvider, $sceDelegateProvider){

      $sceDelegateProvider.resourceUrlWhitelist([ 'self','*://**', '*://**']);



<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="cordova.js"></script>

<link href="lib/ionic/css/ionic.css" rel="stylesheet">  

<script src="js/Chart.js"></script>
<script src="js/angular-charts.js?id=123945378"></script>

<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/routes.js"></script>
<script src="js/directives.js"></script>
<script src="js/services.js"></script>

I don’t even need to use the new code in a controller and it is already failing with this error. I have tried “Chart.js”, “chart.js”, “chartjs”, and “Chartjs”, but nothing seems to work.

Here is my js directory and it seems pretty simple:

Here is my node_module directory:

All I have to do is remove the directive and the app starts working again without an issue. Seems to happen to any code I try to use from the node_modules folder.

Anyone have a thought?



I think something is wrong with the dependency file
Do this

npm install angular-chart.js --save

and add the right files in your index.html