2016-03-05 44 views
3

我試圖將我的node.js項目部署到我的App Engine項目。我使用的命令是gcloud preview app deploy app.yaml嘗試將Node.js項目部署到Google應用引擎時出錯

這是我的app.yaml文件:

runtime: nodejs 
vm: true 
skip_files: 
    - ^(.*/)?.*/node_modules/.*$ 

,這是我得到的錯誤: ERROR: (gcloud.preview.app.deploy) We were unable to detect the runtime to use for this application. Please specify the [runtime] field in your application yaml file or check that your application is configured correctly.

我敢肯定我已正確設置該項目,也紛紛gcloud init我的gcloud CLI。

任何幫助將不勝感激!

編輯:

$ gcloud --version 
Google Cloud SDK 99.0.0 

bq 2.0.18 
bq-nix 2.0.18 
core 2016.02.26 
core-nix 2016.02.05 
gcloud 
gsutil 4.17 
gsutil-nix 4.15 

$ gcloud components list 

Your current Cloud SDK version is: 99.0.0 
The latest available version is: 99.0.0 

┌─────────────────────────────────────────────────────────────────────────────────┐ 
│         Components         │ 
├───────────────┬─────────────────────────────────┬───────────────────┬───────────┤ 
│  Status │    Name    │   ID  │ Size │ 
├───────────────┼─────────────────────────────────┼───────────────────┼───────────┤ 
│ Not Installed │ Cloud Datastore Emulator  │ gcd-emulator  │ 38.1 MiB │ 
│ Not Installed │ Cloud Pub/Sub Emulator   │ pubsub-emulator │ 10.1 MiB │ 
│ Not Installed │ gcloud Alpha Commands   │ alpha    │ < 1 MiB │ 
│ Not Installed │ gcloud Beta Commands   │ beta    │ < 1 MiB │ 
│ Not Installed │ gcloud app Java Extensions  │ app-engine-java │ 101.4 MiB │ 
│ Not Installed │ gcloud app Python Extensions │ app-engine-python │ 7.2 MiB │ 
│ Not Installed │ kubectl       │ kubectl   │ 5.2 MiB │ 
│ Installed  │ BigQuery Command Line Tool  │ bq    │ < 1 MiB │ 
│ Installed  │ Cloud SDK Core Libraries  │ core    │ 3.9 MiB │ 
│ Installed  │ Cloud Storage Command Line Tool │ gsutil   │ 2.6 MiB │ 
│ Installed  │ Default set of gcloud commands │ gcloud   │   │ 
└───────────────┴─────────────────────────────────┴───────────────────┴───────────┘ 
+0

你上過哪個版本的'gcloud'?你已經安裝了什麼擴展?可以用'gcloud --version'和'gcloud components list'檢查 –

+0

編輯後的相關信息,謝謝! – noodlez040

回答

5

嘗試增加--verbosity =調試你的 「gcloud預覽應用程序部署」 命令來查看發生了什麼事情。很可能,gcloud無法識別您的應用程序,比如丟失或無效的package.json。這被錯誤地報告爲無法識別的運行時。

要被識別爲node.js應用程序,您必須具有server.js文件或具有包含指定「start」命令的「scripts」部分的package.json文件。

+0

將'scripts> start'添加到'package.json'爲我工作。謝謝! – mattr

+0

謝謝!我有一個問題,1 comma -_- – noodlez040

相關問題