2017-11-07 17 views
0

ではない、私はちょうど私のindex.jsファイルへの最初の要件を追加することによって開始:Googleクラウド機能:(...)が必要です私はGoogleのクラウド機能を配備しようとしていた機能Googleのクラウド

// Import the Google Cloud client libraries 
const nl = require('@google-cloud/language')(); 
const speech = require('@google-cloud/speech')(); 
const storage = require('@google-cloud/storage')(); 

しかし、展開するときに、私は、次のメッセージが表示されます:

Detailed stack trace: TypeError: require(...) is not a function 

をこれだけの@グーグル、クラウド/音声と@ Googleのクラウド/言語モジュールで発生、@グーグル・クラウド/ストレージ・モジュールは次のように細かいロードされています関数(私は最初の2つをコメントしてテストしました)。

アドバイスをいただければ幸いです。

Borrigan

+0

は、この上の任意のニュース?同じ問題に直面している。 – galgo

+0

私は、少なくとも言語パッケージが環境変数を使用していることを知りました – galgo

答えて

0
Google cloud function are nodejs modules so the syntax is same as nodejs syntax. 

Regarding your problem: 

you have to write 
const storage = require('@google-cloud/storage'); 
(without() at the end of each statement) 

So the correct declaration will be: 

// Import the Google Cloud client libraries 
const nl = require('@google-cloud/language'); 
const speech = require('@google-cloud/speech'); 
const storage = require('@google-cloud/storage'); 

I hope this helps. 
関連する問題