You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to contribute a patch to the library, and tried to follow the CONTRIBUTING setup instructions.
I am running a Windows / Git Bash setup.
npm test and npm samples-test runs without problems (however samples-test is empty).
When running npm system-test, I came across the following problems:
Authentication-related problems
Authenticating with GCP
Using gcloud auth application-default login as per the instructions, I got the following error:
Your application has authenticated using end user credentials from the Google Cloud SDK
or Google Cloud Shell which are not supported by the translate.googleapis.com.
We recommend configuring the billing/quota_project setting in gcloud or using a service account
through the auth/impersonate_service_account setting.
For more information about service accounts and how to use them in your application,
see https://cloud.google.com/docs/authentication/.
To solve this, I had to manually create an application credentials file, and use export GOOGLE_APPLICATION_CREDENTIALS="...".
Using the Cloud Translation API
After authenticating as above, I got the following error in it should send data in a POST:
Cloud Translation API has not been used in project XXXXXXX before or it is disabled. Enable it by visiting
https://console.developers.google.com/apis/api/translate.googleapis.com/overview?project=XXXXXXX
then retry.
If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.'
To solve this I had to manually enable the Cloud Translation API on my project.
Using the Google Storage API
After authenticating as above, I got the following error in should handle multi-part uploads:
I noticed the code referenced https://storage.googleapis.com/storage/v1/b/${projectId}/o so I had to manually create a storage bucket with the same name as my project id.
Webpack-related problems
Webpack config for the systems test didn't exclude tls, net and http2. I had to add them.
After that, I still got the following error during build:
ERROR in ./node_modules/googleapis-common/build/src/http2.js
Module not found: Error: Can't resolve 'http2' in 'C:\(REDACTED)\node_modules\googleapis-common\build\src'
@ ./node_modules/googleapis-common/build/src/http2.js 16:14-30
@ ./node_modules/googleapis-common/build/src/apirequest.js
@ ./node_modules/googleapis-common/build/src/index.js
@ ./src/index.ts
I guess it was due to backslash-delimited path in the exclusion rules to I transformed each like
test: /src\/http2/
to
test: /src(\/|\\)http2/
I'm not sure this is the cleanest way to achieve that but it finally worked.
I am proposing a PR including the webpack-related fixes.
However the authentication-related fixes don't imply any code change. Maybe we should update the CONTRIBUTING docs instead?
Environment details
OS: Windows 10
Node.js version: 12.18.0
npm version: 6.14.4
googleapis-common version: 4.4.0
Steps to reproduce
Checkout the repo under Windows
Run npm run system-test
The text was updated successfully, but these errors were encountered:
* Properly add `tls`, `net` and `http2` node modules to the exclusion
list for the `system-test` webpack build.
* Replace hard-coded slashes (`/`) with either slashes or backslashes
in the module exclusion rules for the `system-test` webpack build.
Partially addresses googleapis#327.
I wanted to contribute a patch to the library, and tried to follow the CONTRIBUTING setup instructions.
I am running a Windows / Git Bash setup.
npm test
andnpm samples-test
runs without problems (howeversamples-test
is empty).When running
npm system-test
, I came across the following problems:Authentication-related problems
Authenticating with GCP
Using
gcloud auth application-default login
as per the instructions, I got the following error:To solve this, I had to manually create an application credentials file, and use
export GOOGLE_APPLICATION_CREDENTIALS="..."
.Using the Cloud Translation API
After authenticating as above, I got the following error in
it should send data in a POST
:To solve this I had to manually enable the Cloud Translation API on my project.
Using the Google Storage API
After authenticating as above, I got the following error in
should handle multi-part uploads
:I noticed the code referenced
https://storage.googleapis.com/storage/v1/b/${projectId}/o
so I had to manually create a storage bucket with the same name as my project id.Webpack-related problems
Webpack config for the systems test didn't exclude
tls
,net
andhttp2
. I had to add them.After that, I still got the following error during build:
I guess it was due to backslash-delimited path in the exclusion rules to I transformed each like
to
I'm not sure this is the cleanest way to achieve that but it finally worked.
I am proposing a PR including the webpack-related fixes.
However the authentication-related fixes don't imply any code change. Maybe we should update the CONTRIBUTING docs instead?
Environment details
googleapis-common
version: 4.4.0Steps to reproduce
npm run system-test
The text was updated successfully, but these errors were encountered: