Javascript bot programming using Gemini API, NodeJS and CryptoCompare - DISCUSSION

try to add .catch(console.error) at the end of your .then().

So that will trigger an error message from the server in case you have some error in the parameters.

restClient.newOrder({
amount:10, 
price:100, 
side:"buy", 
symbol: "btcusd"
}).then(
response => console.log(response)
).catch(console.error)

Carlos Z

Thanks Carloz, will do

Hi @thecil I think we’re getting somewhere, i’ve included the .catch(console.error) and received the following:

PS C:\Users\dell\Desktop\TradingBot> node index.js
{
  result: 'error',
  reason: 'InvalidSignature',
  message: 'InvalidSignature'
}

Could you let me know what the signature refers to?

Thanks again

1 Like

Your key should start with account- then the numbers, verify your Gemini API keys.

Carlos Z

I am new to JS and was able to create an image on my computer. Were we supposed to upload an image on Ivan/Tech? Not sure where to put these assignments if they are to be completed on the forum.

1 Like

Hey @Lorraine, hope you are ok.

I have seen you already find your way to post this question on the proper topic.

Our team will be helping you soon with the problem, but I could suggest you to share your code to see what is the problem.
https://forum.ivanontech.com/t/faq-how-to-post-code-in-the-forum/35357/2

Also here you can learn more about how to add images on HTML.

PD: please keep this topic related to the course, i know your question is about JS, so any case we will answer you in the specific topic next time :nerd_face:

Carlos Z

Hello im trying to install Yarn in the terminal but when i try this appears:
MacBook-Pro-de-Eduardo-3:~ eduardocarrillodelapena$ npm install -g yarn

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm ERR! code EACCES

npm ERR! syscall access

npm ERR! path /usr/local/lib/node_modules

npm ERR! errno -13

npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’

npm ERR! [Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’] {

npm ERR! errno: -13,

npm ERR! code: ‘EACCES’,

npm ERR! syscall: ‘access’,

npm ERR! path: ‘/usr/local/lib/node_modules’

npm ERR! }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/eduardocarrillodelapena/.npm/_logs/2021-05-11T17_38_34_813Z-debug.log

MacBook-Pro-de-Eduardo-3:~ eduardocarrillodelapena$ npm install --global yarn

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm ERR! code EACCES

npm ERR! syscall access

npm ERR! path /usr/local/lib/node_modules

npm ERR! errno -13

npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’

npm ERR! [Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’] {

npm ERR! errno: -13,

npm ERR! code: ‘EACCES’,

npm ERR! syscall: ‘access’,

npm ERR! path: ‘/usr/local/lib/node_modules’

npm ERR! }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/eduardocarrillodelapena/.npm/_logs/2021-05-11T17_42_24_211Z-debug.log

Please, help me! :frowning:

1 Like

Hey @Eduardo_Carrillo, hope you are ok.

You might want to check this guide: https://tecadmin.net/install-yarn-macos/

Also maybe you just need to run your setup through admin role (sudo).

Carlos Z

Thanks i could install brew but when i try to install through brew or nps doesnt install.
I even tried with this link : curl -o- -L https://yarnpkg.com/install.sh | bash ‘’ but this happened it needs a profile is not found. can you help me?: Captura de pantalla 2021-05-11 a la(s) 15.49.50

just solved it, i had to update my OS. I updated from Sierra to Mojave.

1 Like

What do you do if you use Linux?

1 Like

You can use npm or yarn both are package managers and you can have both installed, i do use both of them (some packages use yarn, some npm).

Carlos Z

Cool, thanks Carlos.

Troy

In the homework. of making the minute, day, hour MA
when im trying to code the dayMA it doesnt recognize the property close.
i did minute and hour MA ok.
i even copied the code from the others and fixed the names many times but it appears the same error again and again…
can anyone. help me please?Captura de Pantalla 2021-05-13 a la(s) 13.34.28

1 Like

Hey @Eduardo_Carrillo, hope you are ok.

Please provide your code in the following way:

Then i will try to replicate your issue to give you a feedback :nerd_face:

Carlos Z

I am getting this error message. Though the file is there, power shell is stating it isn’t there. Please advise
Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\ragib> cd “C:\Users\ragib\OneDrive\Documents\botjs\bot.js”
cd : Cannot find path ‘C:\Users\ragib\OneDrive\Documents\botjs\bot.js’ because it does not exist.
At line:1 char:1

  • cd “C:\Users\ragib\OneDrive\Documents\botjs\bot.js”
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\ragib\...ts\botjs\bot.js:String) [Set-Location], ItemNotFoundE
     xception
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
    
    

PS C:\Users\ragib> cd “C:\Users\ragib\OneDrive\Documents\botjs\bot2.js”
cd : Cannot find path ‘C:\Users\ragib\OneDrive\Documents\botjs\bot2.js’ because it does not exist.
At line:1 char:1

  • cd “C:\Users\ragib\OneDrive\Documents\botjs\bot2.js”
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\ragib\...s\botjs\bot2.js:String) [Set-Location], ItemNotFoundE
     xception
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
    
    

PS C:\Users\ragib>

thank you, I’ll try this option

PS C:\Users\ragib\OneDrive\Documents\botjs> Is this OK? (yes)

PS C:\Users\ragib>
PS C:\Users\ragib> cd “C:\Users\ragib\OneDrive\Documents\botjs”
PS C:\Users\ragib\OneDrive\Documents\botjs> npm install yarn --global

[email protected] preinstall C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn
:; (node ./preinstall.js > /dev/null 2>&1 || true)

C:\Users\ragib\AppData\Roaming\npm\yarn -> C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
C:\Users\ragib\AppData\Roaming\npm\yarnpkg -> C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js

  • [email protected]
    added 1 package in 4.944s
    PS C:\Users\ragib\OneDrive\Documents\botjs> “C:\Users\ragib\OneDrive\Documents\botjs\bot.js”
    C:\Users\ragib\OneDrive\Documents\botjs\bot.js
    PS C:\Users\ragib\OneDrive\Documents\botjs> npm install yarn --global

[email protected] preinstall C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn
:; (node ./preinstall.js > /dev/null 2>&1 || true)

C:\Users\ragib\AppData\Roaming\npm\yarnpkg -> C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
C:\Users\ragib\AppData\Roaming\npm\yarn -> C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js

I followed the path for yarn. When I try to install it does not let me or recognize the file. I went into windows and set it to enable scripting.
the file will not install. What do you suggest?
Thank you, Rachel

1 Like

Hey @Rachel3, hope you are ok.

What is exactly the issue? you have installed yarn properly (apparently no errors).

Some times powershell might run into issues with some programs. I advice you to use the windows console (CMD) that one will give you less issues.

basically you should learn how to move into folders in CLI (command line interface), cd is the command keyword you use to go into a folder… the first error in your post is that your path finish with a file, so cd is not intended to open the file, just the folder, so any time you need to go into a folder, just finish the path with the folder name like your example :nerd_face:

Carlos Z

Hi!
Please help me.
I can not mark “Installing NodeJS & Atom” lecture complete. It just doesn not happen. I tried several times, but it just cannot let me move on. In other courses it works.