I am trying to establish a Cloud SQL proxy connection with Google Cloud. Below is my package.json
:
{
"name": "folder-name",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"db:proxy": ".\\cloud_sql_proxy -instances=vector-123456:us-east1:superdb=tcp:0.0.0.0:1234"
},
"author": "",
"license": "ISC"
}
When I run the command npm run db:proxy
the following ERROR shows up:
> ./cloud_sql_proxy -instances=vector-123456:us- east1:superdb=tcp:0.0.0.0:1234
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hhhh@1.0.0 db:proxy: `.\cloud_sql_proxy -instances=vector-123456:us- east1:superdb=tcp:0.0.0.0:1234`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hhhh@1.0.0 db:proxy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
I am on a Windows 10 64-bit machine and uses cmd
and have Google Cloud Shell installed and its PATH set and is saved in the root directory of where I am running the program from. Why does the error shows up. Is the error related to PATH?.
I tried replacing
"db:proxy": ".\\cloud_sql_proxy -instances=vector-123456:us-east1:superdb=tcp:0.0.0.0:1234"
with
"db:proxy: .\\cloud_sql_proxy -instances=[vector-123456:us- east1:superdb]=tcp:0.0.0.0:1234"
Still the error persists.
Running the command
.\cloud_sql_proxy -instances=vector-123456:us-east1:superdb=tcp:0.0.0.0:1234
on my cmd
inside the folder where Cloud SDK has been installed works perfectly fine.
So Is the problem that it is unable to find .\cloud_sql_program
?
I have set the PATH as follows:
C:\Users\user_name\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin