Keep in mind that it's best to not install libraries globally.  It safer to
just declare your dependencies in your app's package.json and install them
locally using `npm install`.  This prevents a world of headache with
version mismatches.  I only use global installs for things like `lessc`
`share` (from creationix) and other modules that install command-line
scripts.  It's probably best to put them somewhere that other modules won't
find like /usr/local/share and just put /usr/local/share/node_modules/.bin
in your PATH. (I recommend not using NODE_PATH)

On Tue, Mar 20, 2012 at 12:33 PM, Mark Hahn <[email protected]> wrote:

> It is not a big deal since I have only 2 or 3 global modules, but I got
> tripped up when releasing to another server with different nvm location.
>
> I'll take your suggestion to use a common install dir and put it in the
> path.  I didn't know modules were searched by path.
>
>
> On Tue, Mar 20, 2012 at 10:31 AM, C. Mundi <[email protected]> wrote:
>
>> I used to do something like this...
>>
>> Install global modules to a version-agnostic
>> /use/local/share/node_modules and always export NODE_PATH (or similar).
>>
>> But what I found is that I ended up chasing breaking changes when
>> updating node anyway.  So I have jumped on the wagon and now the only thing
>> I install globally is express.  And I am so anxious about adapting to
>> express 3...
>> On Mar 20, 2012 10:08 AM, "Mark Hahn" <[email protected]> wrote:
>>
>>>  I love nvm and npm.  However, whenever I switch to a new version of
>>> node with nvm I have to reinstall all my global npm modules.  Apparently
>>> the global modules are stored in the node directory which is created anew.
>>>
>>>  Is my setup normal?  Is there a way around this problem?
>>>
>>>  --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines:
>>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> For more options, visit this group at
>>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>>
>>  --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to