Cannot Install Bower - Syntax Error

First off, I am a complete novice. I have just started learning programming today and I am trying to learn jQuery. But in order to use jQuery I have had to get bower and npm (node), which has been a confusing ordeal. So I downloaded node:

Node was installed at

/usr/local/bin/node

npm was installed at

/usr/local/bin/npm

Make sure that /usr/local/bin is in your $PATH.

Then I read: Install Bower globally using NPM.

npm install -g bower

Which I tried doing in Chrome with Javascript. Then I read on this site that appropriate syntax is: $ npm config set prefix /usr/local $ npm install -g bower

I have tried a bunch of others too, all the same error SyntaxError: Unexpected identifier

So I'm a newbie that needs some expert guidance on this trivial programming because I am making a mistake somewhere and I have no idea what it is I am doing wrong.

Your error message indicates that you are typing your npm command at a JavaScript prompt. It is not a JavaScript function, it is a separate program. Type it at your normal (e.g. bash) command prompt.

That said, you do not need to go anywhere near Node.js in order to use jQuery. It is most commonly used inside a webpage, not in a Node.js application. See the getting started guide on the jQuery website.