diff options
-rw-r--r-- | doc/link.md | 14 | ||||
-rw-r--r-- | lib/link.js | 3 | ||||
-rw-r--r-- | man1/link.1 | 33 | ||||
-rw-r--r-- | man1/ln.1 | 33 |
4 files changed, 80 insertions, 3 deletions
diff --git a/doc/link.md b/doc/link.md index 32964e45a..dc2e5136b 100644 --- a/doc/link.md +++ b/doc/link.md @@ -33,3 +33,17 @@ For example: Now, any changes to ~/projects/node-redis will be reflected in ~/projects/node-bloggy/node_modules/redis/ + +You may also shortcut the two steps in one. For example, to do the +above use-case in a shorter way: + + cd ~/projects/node-bloggy # go into the dir of your main project + npm link ../node-redis # link the dir of your dependency + +The second line is the equivalent of doing: + + (cd ../node-redis; npm link) + npm link redis + +That is, it first creates a global link, and then links the global +installation target into your project's `node_modules` folder. diff --git a/lib/link.js b/lib/link.js index f891675ad..fd51e2d52 100644 --- a/lib/link.js +++ b/lib/link.js @@ -29,7 +29,8 @@ link.completion = function (opts, cb) { function link (args, cb) { if (npm.config.get("global")) { - return cb(new Error("link should never be --global.")) + return cb(new Error("link should never be --global.\n" + +"Please re-run this command with --local")) } if (args.length) return linkInstall(args, cb) linkPkg(npm.prefix, cb) diff --git a/man1/link.1 b/man1/link.1 index f3fbfab35..89e3d35ce 100644 --- a/man1/link.1 +++ b/man1/link.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs/v0.1 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-LINK" "1" "March 2011" "" "" +.TH "NPM\-LINK" "1" "April 2011" "" "" . .SH "NAME" \fBnpm-link\fR \-\- Symlink a package folder @@ -52,3 +52,34 @@ npm link redis # link\-install the package .P Now, any changes to ~/projects/node\-redis will be reflected in ~/projects/node\-bloggy/node_modules/redis/ +. +.P +You may also shortcut the two steps in one\. For example, to do the +above use\-case in a shorter way: +. +.IP "" 4 +. +.nf +cd ~/projects/node\-bloggy # go into the dir of your main project +npm link \.\./node\-redis # link the dir of your dependency +. +.fi +. +.IP "" 0 +. +.P +The second line is the equivalent of doing: +. +.IP "" 4 +. +.nf +(cd \.\./node\-redis; npm link) +npm link redis +. +.fi +. +.IP "" 0 +. +.P +That is, it first creates a global link, and then links the global +installation target into your project\'s \fBnode_modules\fR folder\. @@ -1,7 +1,7 @@ .\" Generated with Ronnjs/v0.1 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-LINK" "1" "March 2011" "" "" +.TH "NPM\-LINK" "1" "April 2011" "" "" . .SH "NAME" \fBnpm-link\fR \-\- Symlink a package folder @@ -52,3 +52,34 @@ npm link redis # link\-install the package .P Now, any changes to ~/projects/node\-redis will be reflected in ~/projects/node\-bloggy/node_modules/redis/ +. +.P +You may also shortcut the two steps in one\. For example, to do the +above use\-case in a shorter way: +. +.IP "" 4 +. +.nf +cd ~/projects/node\-bloggy # go into the dir of your main project +npm link \.\./node\-redis # link the dir of your dependency +. +.fi +. +.IP "" 0 +. +.P +The second line is the equivalent of doing: +. +.IP "" 4 +. +.nf +(cd \.\./node\-redis; npm link) +npm link redis +. +.fi +. +.IP "" 0 +. +.P +That is, it first creates a global link, and then links the global +installation target into your project\'s \fBnode_modules\fR folder\. |