How can I fix the following Google Cloud Platform deployment error? [Error 3]

1.8k Views Asked by At

I was following the 'Using Cloud SQL with Node.js' tutorial (Using Cloud SQL - Node.js) and the following error occurred when I tried deploying the app to the 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].

I tried searching around but didn't find any solutions to this specific error. Any help would be appreciated. Thanks!

2

There are 2 best solutions below

1
On BEST ANSWER

I think the problem was I didn't properly configure the Google Cloud SDK after installation. Went back to configure it and now it's successfully deploying.

2
On

With npm v2, it is possible that the file tree depth is so long that gcloud has a problem with it.

Check what version of npm you are running

npm -v

If you are running anything older than npm v3, upgrade with this command

npm install -g npm@3

Now remove the old node_modules

Linux/macOS:

rm -r node_modules

Windows:

rd /s /q node_modules

And reinstall with the new version of npm

npm install

Now, the deploy command should work

gcloud preview app deploy