pat310 / google-trends-api

An API layer on top of google trends
https://www.npmjs.com/package/google-trends-api
MIT License
874 stars 174 forks source link

Uncaught ReferenceError: require is not defined #135

Open dacadev-official opened 4 years ago

dacadev-official commented 4 years ago

Hi everyone, i hope you can help me with this, I´m just started to learn

I try to use the APPI but when i make the example

code

I received this error from my web bowser -> Uncaught ReferenceError: require is not defined

and say that the error is in "const googleTrends = require('google-trends-api');"

error

I´m not sure, bt a think that the problem is with the installation, because when I did this, this was the result

installation

philxavier commented 4 years ago

Hey there.. the require needs to happen outside of the 'consultaTrends' function