angular度谷歌login模块投掷404

我正在尝试为Angular2应用程序实施谷歌login。 我运行以下命令。

npm我angular谷歌login

我在node_modules中获得了angular-google- signin文件夹。 在index.html中添加了下面的脚本。

<script defer src="https://apis.google.com/js/platform.js"></script> 

你可以在下面find我的代码:

app.module.ts

 import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { FormsModule } from '@angular/forms'; import { HttpModule, Headers } from '@angular/http'; import { GoogleSignInComponent } from 'angular-google-signin'; @NgModule({ imports: [BrowserModule, FormsModule, HttpModule], declarations: [AppComponent, GoogleSignInComponent], providers: [], bootstrap: [AppComponent] }) export class AppModule { } 

app.component.ts

 import { Component } from '@angular/core'; import { GoogleSignInSuccess } from 'angular-google-signin'; @Component({ selector: 'my-app', template: ` <google-signin [clientId]="myClientId" [width]="myWidth" [theme]="myTheme" [scope]="myScope" [longTitle]="myLongTitle" (googleSignInSuccess)="onGoogleSignInSuccess($event)"> </google-signin> <urls></urls>`, providers: [GoogleSignInSuccess] }) export class AppComponent { private myClientId: string = 'my-client-id'; onGoogleSignInSuccess(event: GoogleSignInSuccess) { let googleUser: gapi.auth2.GoogleUser = event.googleUser; let id: string = googleUser.getId(); let profile: gapi.auth2.BasicProfile = googleUser.getBasicProfile(); console.log('ID: ' + profile .getId()); // Do not send to your backend! Use an ID token instead. console.log('Name: ' + profile.getName()); } } 

的index.html

 <!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> <script src="node_modules/typescript/lib/typescript.js"></script> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script defer src="https://apis.google.com/js/platform.js"></script> <script> System.config({ packages: { app: { format: 'register', defaultExtension: 'js' } } }); System.import('app/boot').then(null, console.error.bind(console)); </script> </head> <body> <my-app>Loading...</my-app> </body> </html> 

我没有得到任何编译错误。 当我运行该网站时,我得到了404错误说:

“(SystemJS)XHR错误(404 Not Found)加载http:// localhost:3000 / angular-google-signin ”

看下面的图片。

在这里输入图像描述

任何人都可以帮助我