如何使用Google Sheets API进行角度项目

时间:2019-07-01 18:10:02

标签: google-sheets-api

我正在使用v4的Google表格API 我是有角度的开发人员 试图交互形式的角度,但我得到了很多错误 测试时

import { Component, OnInit } from '@angular/core';
import bwipjs from 'bwip-angular2';
import {google} from "googleapis";
import { OAuth2Client } from "google-auth-library";



@Component({
  selector: 'app-goo',
  templateUrl: './goo.component.html',
  styleUrls: ['./goo.component.css']
})
export class GooComponent implements OnInit {

  constructor() { } 

  ngOnInit() {
    let client = new google.auth.JWT();
  }

}

..

ERROR in ./node_modules/mime/index.js
Module not found: Error: Can't resolve './types/other' in '/Users/apple/Desktop/makeit/node_modules/mime'
ERROR in ./node_modules/mime/index.js
Module not found: Error: Can't resolve './types/standard' in '/Users/apple/Desktop/makeit/node_modules/mime'
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'child_process' in '/Users/apple/Desktop/makeit/node_modules/google-auth-library/build/src/auth'
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'fs' in '/Users/apple/Desktop/makeit/node_modules/google-auth-library/build/src/auth'
ERROR in ./node_modules/google-p12-pem/build/src/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/apple/Desktop/makeit/node_modules/google-p12-pem/build/src'
ERROR in ./node_modules/googleapis-common/build/src/discovery.js
Module not found: Error: Can't resolve 'fs' in '/Users/apple/Desktop/makeit/node_modules/googleapis-common/build/src'
ERROR in ./node_modules/gtoken/build/src/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/apple/Desktop/makeit/node_modules/gtoken/build/src'
ERROR in ./node_modules/agent-base/patch-core.js
Module not found: Error: Can't resolve 'https' in '/Users/apple/Desktop/makeit/node_modules/agent-base'
ERROR in ./node_modules/https-proxy-agent/index.js
Module not found: Error: Can't resolve 'net' in '/Users/apple/Desktop/makeit/node_modules/https-proxy-agent'
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'os' in '/Users/apple/Desktop/makeit/node_modules/google-auth-library/build/src/auth'
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'path' in '/Users/apple/Desktop/makeit/node_modules/google-auth-library/build/src/auth'
ERROR in ./node_modules/gaxios/build/src/gaxios.js
Module not found: Error: Can't resolve 'stream' in '/Users/apple/Desktop/makeit/node_modules/gaxios/build/src'
ERROR in ./node_modules/google-auth-library/build/src/auth/oauth2client.js
Module not found: Error: Can't resolve 'stream' in '/Users/apple/Desktop/makeit/node_modules/google-auth-library/build/src/auth'
ERROR in ./node_modules/googleapis-common/build/src/apirequest.js
Module not found: Error: Can't resolve 'stream' in '/Users/apple/Desktop/makeit/node_modules/googleapis-common/build/src'

我在编译时遇到此错误 我已经在node js env中运行了相同的代码,效果很好

0 个答案:

没有答案