0

I am using systemjs.config.js file for a Application which is currently in Angular5.x.

I installed npm install --save @swimlane/ngx-graph and npm install --save @swimlane/ngx-charts for creating DAG charts in the application.

I step up a component in the application and the following is in my systemjs.config.js file:

(function (global) {
    System.config({
        paths: {
            'npm:': 'node_modules/',
            'underscore': 'node_modules/underscore/underscore-min.js'
        },
        map: {
            'app': 'app',
            '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
            '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
            '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
            '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
            '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
            '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
            '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
            '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
            'rxjs': 'npm:rxjs',
            'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
            '@ng-bootstrap/ng-bootstrap': 'npm:@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js',
            'ng2-cookies': 'npm:ng2-cookies/cookie.js',
            'file-saver': 'npm:file-saver',
            'moment': 'npm:moment',
            'd3': 'npm:d3/dist',
        },
        packages: {
            app: {
                main: './main.js',
                defaultExtension: 'js',
                meta: {
                    './*.js': {
                        loader: 'systemjs-angular-loader.js'
                    }
                }
            },
            rxjs: {
                defaultExtension: 'js'
            },
            'file-saver': {
                format: 'global',
                main: 'FileSaver.js',
                defaultExtension: 'js'
            },
            'moment' : {
                format: 'global',
                main: 'moment.js',
                defaultExtension: 'js'
            },
            'd3': {
                main: 'd3.js',
                defaultExtension: 'js'
            }
        }
    });
})(this);

When I run the application I get the following core.umd.js errors in the console errors

Do I have to do a step like this till all the 404s are resolved?

map: {
   'd3-array': 'npm:d3-array',
   'd3-shape': 'npm:d3-shape',
   .....
},
packages: {
   d3-array: {
        defaultExtension: 'js'
   },
   ....
}
Shan-Desai
  • 3,101
  • 3
  • 46
  • 89

1 Answers1

-1

d3js and its modules can be installed by: npm install --save d3

If i understood your problem correctly, this should fix the error, you could also add the line

"dependencies": {
    ...
    "d3": "^4.11.0"
    ...
}

to your package.json in the main folder of your angular app.

Eiks
  • 48
  • 5