node.jsgcloud-node

Why can not use gcloud-node in nodejs project


I just start learning how to use gcloud in nodejs project. And I have already done the following step:

npm install gcloud --save

But when I use gcloud in the file named writeLog like this:

var gcloud = require('gcloud')({
projectId: 'testID'
});

There is a Typo note in the picture

Typo note click here

node version : 5.6.0
gcloud version : 0.34.0
I use gcloud module to write log with a function named writeLogs, and export it. In another file named index.js, I require that function like this:

var writeLogs = require('./writeLog');

then use this function.

After I run the project, it shows that
problem click here

I really don't know how to solve this problem. What should I do to fix this?


Solution

  • I'm sure that you can name your variables however you want, but if it makes you feel any better, try naming the variable as 'gCloud' instead of 'gcloud'. Doing so, will make that typo error disappear.

    Also, please update your gcloud package, node and npm to the latest versions and try. Please update your node version to >6 and npm version to >3.10.