My terminal is haywire

Hello again, friends

I spent some time on a few different career paths, all of which asked me to install or update through the terminal. I began with JavaScript and zsh, but then switched to python. Now I’m trying to fire up some .js code, and zsh is throwing up parse errors, the command “const” is something its not longer familiar with, and anything with a ‘=’ throws up an error now too.

I’m not gonna lie, the code is tricky enough, but installing all the peripherals did not go well in the first place. I’ve been procrastinating even writing this post, because I don’t know the first layer of what I’m supposed to know to even be able to clearly state the problem in the first place.

If any of this sounds decipherable, send help

Thanks as always

1 Like


Installation and general terminal usage is not easy. I recommend going the the CC terminal modules or this very good video series to get some more comfort with it: Linux Command Line (01) What Is The Linux Command Line - YouTube

I know it may come off as a roundabout answer, but for me personally until I really dug in to some basic linux/unix it was always scary/frustrating dealing with anything terminal related. Afterwards, at least I had more constructive resources to troubleshoot and slowly chip away at my problems.


First things first, thank you. This guy is a genius.

For all that Codecademy does right, breezing through command line seems like a missed opportunity.

Three things have become clear to me already:

  1. I’m finishing this series, because I’m smarter already.
  2. I didn’t find this in the videos, but my terminal issues have to do with my PATH being incorrect. My terminal is able to process python using the python3 command, but any time I try to use zsh to run a JavaScript file, it is not able to comprehend even the most rudimentary code. The output error lists several problems including issues with declaring a variable using const and an error for every = sign I used.
  3. I copy and pasted from Codecademy into Visual Studio Code code that I know works, to no avail.

Am I getting closer to putting my finger on it? Without knowing where this video series takes me, might answers lie in the videos, or just a greater understanding of command line as a whole?

Thank you, again.


Personally I think learning how to work in the command line is a worthwhile time investment for almost any programmer, I certainly don’t regret it for a second.

As mentioned above even if you do still prefer working with a GUI some things require its use so at the very least getting the basics down makes life easier, isn’t that what it’s all about :grinning_face_with_smiling_eyes:.

Regarding running the javascript file how are you trying to run these files, with node?

If there is a problem with your PATH, where to look...

If there is an issue with your PATH it’s normally something you (or occasionally an errant program) have done in the shell initialisation scripts for your user located under your home folder (it’s not normally deeper than that). If you’re using zsh make sure you’re looking at the relevant zsh profiles (a lot of guidance will refer to bash e.g. bash_profile, bashrc which may never be used if your shell is zsh).

It’s about OSX but this post will give you a rough idea of what items there are and what goes in them- macos - ZSH: .zprofile, .zshrc, .zlogin - What goes where? - Ask Different (the major difference being that OSX makes every new terminal a login shell which few linux systems do, typically the login shell is run just once for your user, hence the login bit). If you’re not using OSX similar guides exist for other systems if you have a wee web search, they’re almost the same aside from the login quirk.

If I had to guess any additions to your PATH would be done in ~/.zshrc so poke your nose in there and see if you can track down any changes :crossed_fingers:.

1 Like