0

我正在关注“将 Cloud SQL 与 Node.js 一起使用”教程(使用 Cloud SQL - Node.js),当我尝试将应用程序部署到 Google Cloud Platform 时出现以下错误。

Beginning deployment...
If this is your first deployment, this may take a while...done.

Verifying that Managed VMs are enabled and ready.
Provisioning remote build service.
Copying certificates for secure access. You may be prompted to create an SSH key
pair.
Building and pushing image for module [default]
----------------------------- DOCKER BUILD OUTPUT ------------------------------

Beginning teardown of remote build environment (this may take a few seconds).
ERROR: gcloud crashed (WindowsError): [Error 3] The system cannot find the path
specified: 'C:\\Users\\username\\Desktop\\nodejs-getting-started\\2-structured-data\\
node_modules\\gcloud\\node_modules\\gce-images\\node_modules\\google-auto-auth\\
node_modules\\google-auth-library\\node_modules\\gtoken\\node_modules\\google-p1
2-pem\\node_modules\\node-forge\\flash\\PooledSocket.as'

If you would like to report this issue, please run the following command:
  gcloud feedback
Deleted [https://www.googleapis.com/compute/v1/projects/nodejscloudex/zones/us-c
entral1-f/instances/gae-builder-vm-20160204t212716].

我尝试四处搜索,但没有找到任何解决此特定错误的方法。任何帮助,将不胜感激。谢谢!

4

2 回答 2

1

使用 npm v2,文件树深度可能太长而gcloud出现问题。

检查您正在运行的 npm 版本

npm -v

如果您正在运行比 npm v3 更早的版本,请使用此命令进行升级

npm install -g npm@3

现在删除旧的 node_modules

Linux/macOS:

rm -r node_modules

视窗:

rd /s /q node_modules

并用新版本的npm重新安装

npm install

现在,部署命令应该可以工作了

gcloud preview app deploy
于 2016-03-10T23:13:08.487 回答
0

我认为问题是我在安装后没有正确配置 Google Cloud SDK。回去配置它,现在它已成功部署。

于 2016-02-08T18:27:02.287 回答