GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — path.replace is not a function · Issue #1445 · googleapis/google-cloud-node

path.replace is not a function #1445

New issue
Copy link
New issue
Copy link
Closed
Closed
path.replace is not a function#1445
Copy link
Assignees
stephenplusplus
Labels
coretype: questionRequest for information or clarification. Not an issue.

Description

@commit-master
commit-master
opened on Jul 22, 2016
Issue body actions

Hey guys,

So i'm having the same issue as #1389 and i cannot identify why. Here are the logs of the error :

var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase();
                 ^

TypeError: path.replace is not a function
    at Mime.lookup (/Users/devOps/Desktop/_devOps/once-rest/node_modules/mime/mime.js:70:18)
    at GoogleToken.getToken (/Users/devOps/Desktop/_devOps/once-rest/node_modules/gtoken/lib/index.js:55:33)
    at /Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auth-library/lib/auth/jwtclient.js:137:21
    at JWT._createGToken (/Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auth-library/lib/auth/jwtclient.js:225:12)
    at JWT.refreshToken_ (/Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auth-library/lib/auth/jwtclient.js:133:15)
    at JWT.OAuth2Client.refreshAccessToken (/Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auth-library/lib/auth/oauth2client.js:203:8)
    at JWT.OAuth2Client.getAccessToken (/Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auth-library/lib/auth/oauth2client.js:237:10)
    at /Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auto-auth/index.js:118:12
    at addScope (/Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auto-auth/index.js:74:5)
    at Auth.getAuthClient (/Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auto-auth/index.js:49:5)
    at Auth.getToken (/Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auto-auth/index.js:112:8)
    at Auth.authorizeRequest (/Users/devOps/Desktop/_devOps/once-rest/node_modules/google-auto-auth/index.js:16:8)
    at Storage.makeAuthenticatedRequest (/Users/devOps/Desktop/_devOps/once-rest/node_modules/gcloud/lib/common/util.js:371:18)
    at Storage.Service.request (/Users/devOps/Desktop/_devOps/once-rest/node_modules/gcloud/lib/common/service.js:117:15)
    at Storage.getBuckets (/Users/devOps/Desktop/_devOps/once-rest/node_modules/gcloud/lib/storage/index.js:399:8)
    at makeRequest (/Users/devOps/Desktop/_devOps/once-rest/node_modules/gcloud/lib/common/stream-router.js:202:5)

Environment details

  • OS: OS X El Capitan
  • Node.js version: 6.2.1
  • npm version: 3.9.3
  • gcloud-node version: 0.37.0

Steps to reproduce

var gcloud = require('gcloud')({
  keyFilename: key,
  projectId: 'xxxxx-projectId'
});

var gcs = gcloud.storage();
var bucket = gcs.bucket('xxxxxx-bucket');
gcs.getBuckets(function(err, buckets) {
  if (!err) {
    // buckets is an array of Bucket objects.
    console.log(buckets);
  }
});

Thanks!

Activity

  1. stephenplusplus commented on Jul 22, 2016

    @stephenplusplus
    stephenplusplus
    on Jul 22, 2016
    Contributor
    More actions

    What is the value of key?

  2. stephenplusplus
    added
    core
    on Jul 22, 2016
  3. commit-master commented on Jul 22, 2016

    @commit-master
    commit-master
    on Jul 22, 2016
    ContributorAuthor
    More actions

    Its a JSON file downloaded from the Google Dev Console that has project_id, private_key_id, private_key, client_email, client_id, auth_uri

    Also, if is change keyFilename by keyFile the error is gone but I get another one :

    Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information.
    
  4. stephenplusplus commented on Jul 22, 2016

    @stephenplusplus
    stephenplusplus
    on Jul 22, 2016
    Contributor
    More actions

    Is it the object itself, or a string path to the file? If you want to provide an object, use credentials instead of keyFilename. keyFilename expects a string path to the JSON file, i.e. /Users/stephen/dev/keyfile.json.

    Reacted by Paul Borensztein
  5. commit-master commented on Jul 22, 2016

    @commit-master
    commit-master
    on Jul 22, 2016
    ContributorAuthor
    More actions

    Oh alright it's working now, using credentials. I suggest you add it to the documentation, it's pretty confusing (at least for me)

    Thanks again ! 👍

  6. stephenplusplus commented on Jul 22, 2016

    @stephenplusplus
    stephenplusplus
    on Jul 22, 2016
    Contributor
    More actions

    Woo! I'll update the other issue as well in case that was the problem over there.

    Here's a link to the relevant docs page: https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.37.0/gcloud -- a PR would be awesome if you find a way we can explain better. Thanks!

  7. stephenplusplus
    closed this as completedon Jul 22, 2016
  8. stephenplusplus
    added
    type: questionRequest for information or clarification. Not an issue.
    on Jul 22, 2016
  9. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  10. miguelvelezsa
    added 3 commits that reference this issue on Jul 23, 2025

    chore(main): release 4.0.0 (#1445)

    026247f

    feat: server streaming retries (#1496)

    c8b1b4f

    fix: don't retry server streaming calls if retryCodes is the empty ar…

    0e99e86
  11. sofisl
    added 4 commits that reference this issue on Feb 24, 2026

    fix: export v1 and v1beta1 client class types correctly (#1445)

    402ca97

    chore: release 4.9.7 (#1446)

    67f9e35

    fix: adding option to skip back up tests (#1445)

    4b3962f

    chore: release 5.13.0 (#1440)

    68500dd
  12. GautamSharda
    added a commit that references this issue on Mar 5, 2026

    chore(deps): update dependency jsdoc-fresh to v3 (#1445)

    d5b7ec7
  13. sofisl
    added a commit that references this issue on Mar 17, 2026

    fix: don't retry server streaming calls if retryCodes is the empty ar…

    aaabcf5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

coretype: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.