Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 104 lines (78 sloc) 4.262 kb
2f9b0dc @isaacs initial commit
authored
1 # nave
2
3 Virtual Environments for Node
4
5 ## Installation
6
7 If you want a global `nave` command, you could install this thing with npm.
8 But that's not really necessary. You can run the `nave.sh` shell script
9 from here, or symlink it wherever you want.
10
11 ## Usage
12
cf6a289 @isaacs Add the nave use <ver> <prog> to help/README
authored
13 Usage: nave <cmd>
14
15 Commands:
16
2c2cc97 @isaacs update docs
authored
17 install <version> Install the version passed (ex: 0.1.103)
18 use <version> Enter a subshell where <version> is being used
19 use <ver> <program> Enter a subshell, and run "<program>", then exit
20 use <name> <ver> Create a named env, using the specified version.
21 If the name already exists, but the version differs,
22 then it will update the link.
23 usemain <version> Install in /usr/local/bin (ie, use as your main nodejs)
24 clean <version> Delete the source code for <version>
25 uninstall <version> Delete the install for <version>
26 ls List versions currently installed
27 ls-remote List remote node versions
28 ls-all List remote and local node versions
29 latest Show the most recent dist version
30 help Output help information
2f9b0dc @isaacs initial commit
authored
31
3959e6d README.md: Update Usage to the latest help information
Keita Haga authored
32 <version> can be the string "latest" to get the latest distribution.
33 <version> can be the string "stable" to get the latest stable version.
34
2f9b0dc @isaacs initial commit
authored
35 That's about it. Enjoy.
36
2c2cc97 @isaacs update docs
authored
37 When you're done using a specific version of node, just exit the shell to return
38 to where you were before using nave.
39
2f9b0dc @isaacs initial commit
authored
40 ## env vars
41
2c2cc97 @isaacs update docs
authored
42 * `$NAVE` The current shell. Either a version, or a name and version.
43 * `$NAVENAME` The name of the current shell. Equal to `$NAVEVERSION` in
44 unnammed environments.
45 * `$NAVEVERSION` The version of node that the current shell is pointing
46 to. (This should comply with `node -v`.)
47 * `$NAVELVL` The level of nesting in the subshell.
48 * `$NAVE_DEBUG` Set to 1 to run nave in `bash -x` style.
49 * `$NAVE_DIR` Set to the location where you'd like nave to do its
50 business. Defaults to `~/.nave`.
82faa8e @isaacs Document NAVE_CONFIG env
authored
51 * `$NAVE_CONFIG` Set this to an array of arguments to pass to
52 `./configure`. Defaults to `("--debug")`. (Note that parens are
53 required to supply multiple arguments. I use `("--debug"
54 "--without-npm")` on my own system, since I'm usually using nave to
55 test npm, so installing it in the subshell doesn't help much.) This
56 can be set in the `~/.naverc` file, or in your normal
57 `~/.bash{rc,_profile}` files.
5bc6eac @isaacs Default jobs to number of CPUs
authored
58 * `$NAVE_JOBS` If set, this will be the number of jobs to run when
59 building node. If this isn't set, it'll use the `$JOBS` env, then try
60 to guess a reasonable value based on the number of CPUs, then fall
61 back on 2 if `sysctl -n hw.ncpu` fails.
1137c97 @isaacs more stuff
authored
62
2c2cc97 @isaacs update docs
authored
63 ## Compatibility
64
65 Prior to version 0.2, nave would run programs as `node <program>`.
cd7ae81 @isaacs Add line about bash requirement
authored
66 However, this is somewhat more limiting, so was dropped. If you prefer the
67 old style, just prefix your command with `node`.
2c2cc97 @isaacs update docs
authored
68
cd7ae81 @isaacs Add line about bash requirement
authored
69 Nave requires bash. It will probably never work on Windows, or other systems
70 lack a native Bourne Again Shell. Sorry.
1137c97 @isaacs more stuff
authored
71
d8800f2 @isaacs Don't trigger infinite reloading in oh-my-zsh
authored
72 Nave logins work with bash and zsh. If your shell doesn't set the
73 `BASH` environment variable, then nave assumes you're using zsh. As
74 such, strange archaic shells like sh, csh, tcsh, ksh, and the like will not
75 work.
7666933 @isaacs Work around cases where PATH is set explicitly in .bashrc
authored
76
77
78 ## Configuration
79
80 Nave will source `~/.naverc` on initialization of a new subshell, if it
81 exists and is readable.
82
83 You may control the place where nave puts things by setting the
84 `NAVE_DIR` environment variable. However, note that this must be set
85 somewhere *other* than `~/.naverc`, since it needs to be set in the
86 *parent* shell where the `nave` command is invoked.
87
88 By default, nave puts its stuff in `~/.nave/`. If this directory does
89 not exist and cannot be created, then it will attempt to use the location
90 of the nave.sh bash script itself. If it cannot write to this location,
91 then it will exit with an error.
92
1137c97 @isaacs more stuff
authored
93 ## Credits
94
95 nave borrows concepts, inspiration, and code from Tim Caswell's "nvm" and Kris
96 Kowal's "sea" programs.
97
98 Sea is really nice, but is very tied to Narwhal. Also, it's a require.paths
99 manager, which nave is not.
100
101 Nvm is also really nice, but has to be sourced rather than being run, and
102 thus is a little bit wonky for some use cases. But it doesn't involve
2c2cc97 @isaacs update docs
authored
103 subshells, which makes it better for some others.
Something went wrong with that request. Please try again.