Skip to content

Commit ef7d0ae

Browse files
committed
Add node.js
1 parent d5880f3 commit ef7d0ae

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

README.md

+41-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The document assumes you are new to Mac. The steps below were tested on **OS X M
1818
- [IPython](#ipython)
1919
- [Numpy and Scipy](#numpy-and-scipy)
2020
- [MySQL](#mysql)
21+
- [Node.js](#nodejs)
2122
- [Projects folder](#projects-folder)
2223

2324
## System update
@@ -440,18 +441,54 @@ You can find the MySQL Workbench download [here](http://www.mysql.com/downloads/
440441

441442
This really depends on how you want to organize your files, but I like to put all my version-controlled projects in `~/Projects`. Other documents I may have, or things not yet under version control, I like to put in `~/Dropbox` (if you have Dropbox installed), or `~/Documents`.
442443

443-
## Todo
444+
## Node.js
444445

445-
- Node
446-
- Ruby
447-
- Apps
446+
Install [Node.js](http://nodejs.org/) with Homebrew:
447+
448+
$ brew update
449+
$ brew install node
450+
451+
The formula also installs the [npm](https://npmjs.org/) package manager. However, as suggested by the Homebrew output, we need to add `/usr/local/share/npm/bin` to our path so that npm-installed modules with executables will have them picked up.
452+
453+
To do so, add this line to your `~/.path` file, before the `export PATH` line:
454+
455+
PATH=/usr/local/share/npm/bin:$PATH
456+
457+
Open a new terminal for the `$PATH` changes to take effect.
458+
459+
Node modules are installed locally in the `node_modules` folder of each project by default, but there are at least two that are worth installing globally. Those are [CoffeeScript](http://coffeescript.org/) and [Grunt](http://gruntjs.com/):
460+
461+
$ npm install -g coffee-script
462+
$ npm install -g grunt
448463

464+
### Npm usage
449465

466+
To install a package:
450467

468+
$ npm install <package> # Install locally
469+
$ npm install -g <package> # Install globally
451470

471+
To see what's installed:
472+
473+
$ npm list # Local
474+
$ npm list -g # Global
475+
476+
To find outdated packages (locally or globally):
452477

478+
$ npm outdated [-g]
453479

480+
To upgrade all or a particular package:
481+
482+
$ npm upgrade [<package>]
483+
484+
To uninstall a package:
454485

486+
$ npm uninstall <package>
487+
488+
## Todo
489+
490+
- Ruby
491+
- Apps
455492

456493

457494

0 commit comments

Comments
 (0)