Error When Running CLI Wallet



I’m doing Mark’s NEM course and in the last lesson of a section called Building a CLI Wallet, I got an error when trying to run node bin/wallet.js balance in the terminal.

Here’s a screenshot of the error:

The error

At the top of the error it says ReferenceError: getAccountBalances is not defined.

The only mention of getAccountBalances is on line 93:


I think the red squiggly line underneath it means that it hasn’t been defined yet. What should I do now?

If you need more code or details please tell me. Thanks for your help and time! :grinning:


Hello, welcome to NEM :slight_smile:

This error means that the function isn’t defined you. You need to define the function getAccountBalances in wallet.js. It must exist in the same file as the rest of your code. I believe Mark goes into this in the last video

Should be something like that ^^. Also make sure to check for typos in your code.


Thanks @crackTheCode! It now works. :slight_smile:

Thank you!


Great! Happy coding! Remember that the NEM projects Telegram group is also quite active, and will help with any more questions you may have:


Okay, thanks for the link!