Sorry for the noob question. It's my first time in Node from PHP usually. I put Node onto a subdomain, to not break my PHP site.
I have app.js with contents:
const googleTrends = require('google-trends-api');
googleTrends.interestOverTime({keyword: 'Women\'s march'})
.then(function(results){
console.log('These results are awesome', results);
})
.catch(function(err){
console.error('Oh no there was an error', err);
});
I have /public/index.php - blank file.
I have /node_modules/google-trends-api/ - from installing it.
I run 'node app.js' on the command line, then:
Oh no there was an error [TypeError: undefined is not a function]
Sorry for the noob question. It's my first time in Node from PHP usually. I put Node onto a subdomain, to not break my PHP site.
I have app.js with contents:
I have /public/index.php - blank file. I have /node_modules/google-trends-api/ - from installing it.
I run 'node app.js' on the command line, then:
Oh no there was an error [TypeError: undefined is not a function]
The code seems to be working in https://npm.runkit.com/google-trends-api, but I can't get it to work on my Dreamhost VPS. On RunKit it outputs this: