'How to resolve "Uncaught ApiError Error: Project project-name has been deleted." issue in VSCode for Google Cloud function development?

I am very much new to GCP & Node JS, recently I started working on a cloud function development in Nodejs.
I researched many websites to begin my development so don't know which step I followed but somehow I am able to develop a simple Nodejs project that connects to Google BigQuery to execute some SQL statement on my local machine in VSCode IDE.
At first, as it was giving some error while connecting to GCP, I found a few solutions like configuring the project in Google Cloud Shell to authenticate it.
Everything went smoothly and my code connected to BigQuery successfully. Some days later I shutdown a new project I created on GCP Console, then tried to execute my local code which worked perfectly earlier. It is now throwing an error as soon as it tries to connect to BigQuery part of the code.
Error is:

Uncaught ApiError Error: Project project-X has been deleted.

I tried to config new project using the command:

gcloud config set project myProject-XYZ

output is: Updated property [core/project].

Then again I tried to run my code in VS Code, but the problem still persists. Not sure where to set a new project or remove reference to the old/shutdown project.
I am expecting some guidance in order to understand this development.



Solution 1:[1]

Reviewing information for GCP projects, the following could help with the project you will use.

There are several possible identifiers for GCP projects:

  • Each project is granted a 12-digit identifier called a "project number."
  • When creating a project, you can choose a unique alphanumeric ID, however it cannot be modified. The default value is frequently obvious-animal-1234.
  • "project name" is a freeform text string that you can alter at any time.

Additionally to the information above, you can run gcloud projects list to see a list of projects and their ID/number/name to verify you are using the right identifier.

Remember that you should use the project ID with gcloud.

Do you have in mind that the Cloud Resource Manager API should be enabled in your Google Cloud Console?

Here is the direct link to the App Engine Admin API.

Now, according to the last part of your question, you can use the command: gcloud config unset account

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1