为什么gcloud组件更新命令总是显示重启命令

When I want to deploy my Go app to App Engine, I found that I have to install the app-engine-go. And it even said the installation is on a new window, no window popped out.

https://github.com/ChihchengHsieh/ProblemsScreenShot/blob/master/image-2.png

C:\go-work\src\orderFunc>gcloud app deploy
The component [app-engine-go] is required for staging this
application.

Restarting command:
  $ gcloud components install app-engine-go

Installing component in a new window.

Please re-run this command when installation is complete.
    $ gcloud app deploy

When I run the command gcloud components install app-engine-go and gcloud components update, it shows:

https://github.com/ChihchengHsieh/ProblemsScreenShot/blob/master/image.png

C:\go-work\src\orderFunc>gcloud components install app-engine-go

Restarting command:
  $ gcloud components install app-engine-go


C:\go-work\src\orderFunc>gcloud components update

Restarting command:
  $ gcloud components update


C:\go-work\src\orderFunc>gcloud components install app-engine-go

Restarting command:
  $ gcloud components install app-engine-go

I already tried reinstalling the google cloud SDK, but it's the same.

I expect it can show some installation process.

I was trying to deploy a quickstart for .NET Google App Engine application and I run into the same issue. My issue was that I needed to execute $ gcloud components install beta to be able to deploy my GAE .NET app. And I was getting the same behavior as yours. PowerShell would print

Restarting command:
  $ gcloud components install beta

but nothing actually happened. No window popup nor installation progress in the same window where I run the command. Also non of the other commands for installing or updating components were working. I could only list them with $ gcloud components list, but not install nor update any of them.

SOLUTION

I have noticed that if you run PowerShell with administrative privileges, it will open a window in C:\Windows\system32 directory. If you execute the command there, then another window will pop up and will proceed with installation or update of gcloud components. However if you cd into different directory the behavior will be as mentioned in this issue.

So to resolve this:

  1. Run PowerShell as Administrative
  2. If the directory is different than what I described above execute $ C:\Windows\system32 otherwise go to Step 3
  3. Execute any command you want for gcloud components. e.g. $ gcloud components update or gcloud components install beta etc.
  4. A window should popup and proceed with the installation or update of the components.