import { Injectable } from '@angular/core';
@Injectable()
export class ManualService {
constructor() {
// Imports the Google Cloud client library.
const Storage = require('@google-cloud/storage');
// Instantiates a client. If you don't specify credentials when constructing
// the client, the client library will look for credentials in the
// environment.
const storage = Storage();
// Makes an authenticated API request.
storage
.getBuckets()
.then((results) => {
const buckets = results[0];
console.log('Buckets:');
buckets.forEach((bucket) => {
console.log(bucket.name);
});
})
.catch((err) => {
console.error('ERROR:', err);
});
}
}
我正在我的angular2 webapp中部署Google云视觉Ocr。但是当我在我的webapp代码中添加此代码时,我收到了很多错误。请帮我解决这个问题。
答案 0 :(得分:1)
这样做
npm install
或
sudo npm install