Leo4815162342 / dukascopy-node

✨ Download historical price tick data for Crypto, Stocks, ETFs, CFDs, Forex via CLI and Node.js ✨
https://dukascopy-node.app
MIT License
350 stars 66 forks source link

No output in VS Code #92

Closed rampager525 closed 2 years ago

rampager525 commented 2 years ago

Hi I am new to javascript and VS Code. I've just installed the Dukascopy-Node and NPM package on VS Code, but when I run my code to get Dukascopy data in CSV form there's no output.

What's the issue here?

Screenshot 2022-08-22 at 11 29 22 AM
Leo4815162342 commented 2 years ago

@rampager525

Which command are you running to execute the script? Seems like you trying to run it via bash.

You can execute the script either via nodeJs

node app.js

or with CLI, in your case:

npx dukascopy-node -i eurusd -from 2022-08-01 -to 2022-08-15 -t d1 -f csv
rampager525 commented 2 years ago

@Leo4815162342 I'm running it via bash, and i executed it by typing 'node app.js' in my terminal, but nothing shows up.

When i run the command on my Mac terminal instead of VS Code terminal, the data is outputted. What's the potential issues here?

Leo4815162342 commented 2 years ago

@rampager525 seems like nodejs paths are messed up in the vs code terminal. And it seems to run your node script as if it is a bash script. Does closing/re-opening vscode terminal help?

I'd recommending googling something like this to try to solve it: https://www.google.com/search?q=bash%3A+syntax+error+near+unexpected+token+nodejs

rampager525 commented 2 years ago

It works after I shut down VS Code and relaunch it lol. Strange. Not sure if this always happens.

Thanks for resolving this issue anyways !