1

お世話になりました。 私はNPMとGoogleのクラウドをインストールし、ただ好き:Google CloudがNode.jsで動作していません

npm install --save google-cloud 

その後、私はそのように私のコードで実装:

var gcloud = require('google-cloud')({ 
    projectId: "czernitzki-148120", 
    keyFilename: './service.json' 
}); 

私はOwnerアクセス権を持つ新しいサービスアカウントのキーを作成し、そのファイルをservice.jsonに入れます。 service.jsonは、上記のコードを持つファイルと同じディレクトリにあります。私は、アプリケーションを起動した後、それは私がcreate-react-appと反応し使用しています

上記
Error in ./~/google-cloud/~/protobufjs/dist/ProtoBuf.js 
Module not found: [CaseSensitivePathsPlugin] `C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\ByteBuffer\dist\ByteBufferAB.js` does not match the corresponding path on disk `bytebuffer`. 

@ ./~/google-cloud/~/protobufjs/dist/ProtoBuf.js 25:8-39 

Error in ./~/google-cloud/~/bytebuffer/dist/ByteBufferAB.js 
Module not found: [CaseSensitivePathsPlugin] `C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\Long\dist\Long.js` does not match the corresponding path on disk `long`. 

@ ./~/google-cloud/~/bytebuffer/dist/ByteBufferAB.js 26:8-33 

Error in ./~/google-cloud/~/JSONStream/index.js 
Module parse failed: C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\JSONStream\index.js Unexpected character '#' (1:0) 
You may need an appropriate loader to handle this file type. 
SyntaxError: Unexpected character '#' (1:0) 
@ ./~/google-cloud/~/@google-cloud/prediction/src/model.js 25:17-38 

Error in ./~/google-cloud/~/osenv/osenv.js 
Module not found: 'child_process' in C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\osenv 

@ ./~/google-cloud/~/osenv/osenv.js 3:11-35 

Error in ./~/google-cloud/~/uid-number/uid-number.js 
Module not found: 'child_process' in C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\uid-number 

@ ./~/google-cloud/~/uid-number/uid-number.js 9:20-44 

Error in ./~/google-cloud/~/node-pre-gyp/lib/info.js 
Module not found: 'aws-sdk' in C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\node-pre-gyp\lib 

@ ./~/google-cloud/~/node-pre-gyp/lib/info.js 14:14-32 

Error in ./~/google-cloud/~/node-pre-gyp/lib/publish.js 
Module not found: 'aws-sdk' in C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\node-pre-gyp\lib 

@ ./~/google-cloud/~/node-pre-gyp/lib/publish.js 17:14-32 

Error in ./~/google-cloud/~/node-pre-gyp/lib/testbinary.js 
Module not found: 'child_process' in C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\node-pre-gyp\lib 

@ ./~/google-cloud/~/node-pre-gyp/lib/testbinary.js 10:9-33 

Error in ./~/google-cloud/~/node-pre-gyp/lib/unpublish.js 
Module not found: 'aws-sdk' in C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\node-pre-gyp\lib 

@ ./~/google-cloud/~/node-pre-gyp/lib/unpublish.js 15:14-32 

Error in ./~/google-cloud/~/node-pre-gyp/lib/util/compile.js 
Module not found: 'child_process' in C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\node-pre-gyp\lib\util 

@ ./~/google-cloud/~/node-pre-gyp/lib/util/compile.js 9:9-33 

Error in ./~/google-cloud/~/google-auth-library/lib/auth/googleauth.js 
Module not found: 'child_process' in C:\Users\phili\Documents\GitHub\venos\node_modules\google-cloud\node_modules\google-auth-library\lib\auth 

@ ./~/google-cloud/~/google-auth-library/lib/auth/googleauth.js 21:11-35 

からコードに達したときに吹きます。 WindowsとGoogle Compute Engineでテストしました。両方で動作しませんでした。

https://github.com/GoogleCloudPlatform/google-cloud-nodehttps://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/0.3.0/storageのガイドに従っています。

どうすればこの問題を解決できますか?

答えて

0

で解決策を見つけることができますgoogle-cloudはバックエンドモジュールであり、フロントエンドではなくNode.jsで使用する必要があります。

this similar questionのコメントで述べたように、Googleのfront-end api clientを使用してください。

0

あなたはNPM行い、以下のように、見つからないモジュールのためにインストールする必要があります。CaseSensitivePathsPluginに関する最初の2つのエラーのために

npm install aws-sdk 

、あなたはCase Sensitive Paths - Webpack Plugin

+0

私はまだ./~/google-cloud/~/JSONStream/index.jsでこのエラー エラーを取得 モジュールの解析に失敗しました:C:\ Users \ユーザーphiliドキュメントのGitHubを\ \ \ venos \ node_modules \グーグル、クラウド\ node_modules¥JSONStream¥index.js予期しない文字 '#'(1:0) このファイル・タイプを処理するには、適切なローダーが必要な場合があります。 SyntaxError:予期しない文字 '#'(1:0) @ ./~/google-cloud/~/google-cloud/prediction/src/model.js 25:17-38 それ以降はモジュールのエラーが続きます私はchild_processを手作業でインストールしました – speedDeveloper

+0

CaseSensitivePathsPluginに関する私の更新された答えを確認してください – Ayan

+0

ここに記載されているように、create-reaction-appはwebpackの設定を許可していないので、解決できないと私は思っていません。https://github.com/facebookincubator/ create-react-app/issues/99また、モジュールをインストールした後もモジュールのエラーが表示されます。 – speedDeveloper

関連する問題