ionic2 앱에서 google 인증을 구현하려고합니다. 브라우저에서 작동해야합니다. 그래서, 설치 :Typescript 오류, 'gapi'이름을 찾을 수 없습니다. transpile이 실패했습니다.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
node_modules 폴더에서 나는 GAPI과 gapi.auth2 폴더가 있지만 타이프 라이터 오류가 있습니다 : 이름 'GAPI'을 찾을 수 없습니다, transpile 실패
이 경고npm install --save @types/gapi
npm install --save @types/gapi.auth2
있다 .
auth2: any;
login() {
gapi.load('auth2',() => {
this.auth2 = gapi.auth2.init({
client_id: 'xxxxxxxxx.apps.googleusercontent.com',
scope: 'https://www.googleapis.com/auth/userinfo.email'
});
});
};
내 package.json :
transpile이내 코드 실패, 이름 'GAPI'을 찾을 수 없습니다 :
나는 여전히 같은 오류가
npm install typings -g
typings install dt~gapi --global --save
typings install dt~gapi.auth2 --global --save
설치
"@angular/core": "2.2.1",
"ionic-angular": "2.0.0-rc.4",
"ionic-native": "2.2.11",
"rxjs": "5.0.0-beta.12",
"typescript": "2.0.9"
덕분에 나를 위해 일한! 최신 버전의 angular-cli에서는이 편집을위한 올바른 파일이 tsconfig.app.json 일 수 있습니다 – Willy