1
votes

This is my package.json:

"dependencies": {
    "@angular/common": "~6.0.0",
    "@angular/compiler": "~6.0.0",
    "@angular/core": "~6.0.0",
    "@angular/forms": "~6.0.0",
    "@angular/http": "~6.0.0",
    "@angular/platform-browser": "~6.0.0",
    "@angular/platform-browser-dynamic": "~6.0.0",
    "@angular/router": "~6.0.0",
    "angular-in-memory-web-api": "~0.6.0",
    "core-js": "^2.5.4",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26"
  },

Bootstrapping is throwing the following error:

zone.js:1050 GET http://localhost:50803/node_modules/rxjs/operators.js 404 (Not Found)

Error: Fetch error: 404 Not Found
Instantiating http://localhost:50803/node_modules/rxjs/operators.js
Loading http://localhost:50803/node_modules/@angular/core/bundles/core.umd.js
Loading app/main.js
at fetch.js:37
at ZoneDelegate.invoke (zone.js:388)
at Zone.run (zone.js:138)
at zone.js:872
at ZoneDelegate.invokeTask (zone.js:421)
at Zone.runTask (zone.js:188)
at drainMicroTaskQueue..

GET http://localhost:50803/node_modules/rxjs/ 403 (Forbidden)

Any idea what's wrong or how this can be fixed?

1
have you updated node packages properly? - Sukesh Chand

1 Answers

3
votes

You need to do the following changes in your systemjs.config.js file.

Add 'rxjs/operators': 'npm:rxjs/operators', in map object. and change

 rxjs: {
        main: 'index.js',
        defaultExtension: 'js'
 },

with this

rxjs: {
        main: 'index.js',
        defaultExtension: 'js'
},
'rxjs/operators':{
        main: 'index.js',
        defaultExtension: 'js'
},

Complete Systemjs.config.js

/**
 * System configuration for Angular samples
 * Adjust as necessary for your application needs.
 */
(function (global) {
  System.config({
    paths: {
      // paths serve as alias
      'npm:': 'node_modules/'
    },
    // map tells the System loader where to look for things
    map: {
      // our app is within the app folder
        'app': 'CientApp/app',

      // angular bundles
      '@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',

      // other libraries
      'rxjs':                      'npm:rxjs',
      'rxjs/operators':            'npm:rxjs/operators',
      'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
      app: {
        defaultExtension: 'js',
        meta: {
          './*.js': {
              loader: 'CientApp/systemjs-angular-loader.js'
          }
        }
      },
      rxjs: {
        main: 'index.js',
        defaultExtension: 'js'
      },
      'rxjs/operators':{
        main: 'index.js',
        defaultExtension: 'js'
     },
    }
  });
})(this);