I've been trying to understand how to use/install NodeJS recently, but have become confused by tutorials such as this and their use of the $
symbol. For example, the aforementioned tutorial says to use $ which node
to check where on my system Node is installed. However, I have typed this into my Command Prompt (I'm running Windows) and it says that "$ is not recognised as an internal or external command". Why is this happening? I know that Node is installed, because node -v
returns the version as it should.

- 430
- 1
- 7
- 19
-
in said tutorial, `node -v` would probably be represented as `$ node -v` – Kevin B Nov 15 '16 at 20:19
-
Same question but with regard to Python: http://stackoverflow.com/questions/19986306/what-does-the-mean-when-running-commands (The answer is also the same) – Stuart Nov 15 '16 at 20:22
-
Okay, thanks. However, writing 'which node' returns "which is not recognised as..."? – M Smith Nov 15 '16 at 20:24
-
Right, because that command isn't available in windows. – Kevin B Nov 15 '16 at 20:24
-
Your biggest problem following online documentation will be that they frequently use commands not available in windows. The $ sign is kind of a warning sign that they probably have Unix command lines in mind. – Stuart Nov 15 '16 at 20:25
1 Answers
A line starting with $
means run this in your terminal. It's there because, historically, shells such as Bash have ended their prompts with the character $
for normal users and #
for super users (root
account, basically).
It's for documentation and shouldn't be included in the command itself. It has nothing to do with Node.js specifically.
It's most common in documentation that is providing instruction for running a series of commands in your terminal, oftentimes providing expected output (denoted with lines without the $
or #
characters).
For example, the following documentation shows that running the following 5 commands (denoted by the $
prefix) will produce the following output, or similar.
$ ls
package.json node_modules
$ which node
/usr/local/bin/node
$ mkdir lib
$ touch lib/hello.js
$ ls lib
hello.js
Note that this isn't as applicable on Windows - especially when seeing the $
prefix. Sometimes, documentation targeting Windows specifically will start with :\>
or C:\>
instead of $
, though that is much less common.

- 14,451
- 16
- 82
- 145