Re: [nodejs] Possible to select globally installed module over locally install one?

2015-09-13 Thread Zlatko
What do you mean, they're not requireable?

[zlatko@zlatko-mint /tmp]$ node -e "require('express')"
module.js:338
throw err;
  ^
Error: Cannot find module 'express'
[...cut...]

[zlatko@zlatko-mint /tmp]$ npm i -G express
\
[...cut...]

[zlatko@zlatko-mint /tmp]$ node -e "require('express')"
[zlatko@zlatko-mint /tmp]$ 


For the OP, it's possible to do it manually, ie: `
require('/home/zlatko/.nvm/versions/node/v4.0.0/lib/node_modules/gulp');` 
but it's not very scalable.

The problem is - when I bump my node version to, say, 4.0.1, I'd have to 
fix the path. Also, if it were you, you would not have a `/home/zlatko` 
part, but possibly /usr/lib/node_modules or similar.


I don't know if there's a node config option for something like that 
though, probably there isn't.

Zlatko

On Sunday, September 13, 2015 at 12:55:56 AM UTC+2, Sam Roberts wrote:
>
> On Thu, Sep 10, 2015 at 2:51 PM, Bgsosh  
> wrote: 
> > When there is both a globally locally installed version of a module, 
> does 
> > anyone know if it is possible to require() the global version, over the 
> > local one? 
>
> Global modules are misnamed, they are only scripts that you intend to 
> run, they are NEVER requireable. 
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/3dfa3049-a3f1-4903-8ee7-bd49b4333cb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Domain module in nodejs 4.0.0

2015-09-13 Thread Brian Deitte
Here is the PR that made the change:

https://github.com/nodejs/node/pull/141

And here's an expanded explanation:

https://github.com/nodejs/node/pull/141#commitcomment-8951851

While not ideal, I can understand deprecating if you know a different
solution is needed, even if that solution isn't available.  I've stayed
away from domains myself as I've seen bits and pieces of details through
the years on issues using them and in the implementation of them.

On Sat, Sep 12, 2015 at 11:37 PM, Charles Dumas  wrote:

> I'm sorry if this has been discussed somewhere, but I can't seem to find
> it with google:
>
> I noticed the domain module is marked as deprecated in 4.0.0 :
> https://nodejs.org/api/domain.html
>
> The documentation isn't clear about what users should move to instead of
> domains, just that they should be ready to move:
>
> "This module is pending deprecation. Once a replacement API has been
> finalized, this module will be fully deprecated. Most end users should not
> have cause to use this module. Users who absolutely must have the
> functionality that domains provide may rely on it for the time being but
> should expect to have to migrate to a different solution in the future."
>
> Am I missing something or shouldn't a solution / replacement be available
> before declaring something deprecated?
>
>
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/ff8ae14c-e051-4c64-9793-1fcafe4143a2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAGJNxb_r02o1poGzzwmRCPRPeaZWJw46BLpAWkNCf0TppdYXEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Domain module in nodejs 4.0.0

2015-09-13 Thread Ben Noordhuis
On Sun, Sep 13, 2015 at 5:37 AM, Charles Dumas  wrote:
> I'm sorry if this has been discussed somewhere, but I can't seem to find it
> with google:
>
> I noticed the domain module is marked as deprecated in 4.0.0 :
> https://nodejs.org/api/domain.html
>
> The documentation isn't clear about what users should move to instead of
> domains, just that they should be ready to move:
>
> "This module is pending deprecation. Once a replacement API has been
> finalized, this module will be fully deprecated. Most end users should not
> have cause to use this module. Users who absolutely must have the
> functionality that domains provide may rely on it for the time being but
> should expect to have to migrate to a different solution in the future."
>
> Am I missing something or shouldn't a solution / replacement be available
> before declaring something deprecated?

You can find the background story in
https://github.com/nodejs/node/pull/141 and linked issues.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHQurc_02NbdiO4Zo%3Dpf5%2BFbXMAYXOJzWA5vEmw_EJfYKRnx6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Domain module in nodejs 4.0.0

2015-09-13 Thread Ryan Graham
That's what the text you quoted says. It's not deprecated yet, but it will
be as soon as there is a replacement.

1. Pending deprecation, looking for an alternative   <-- now
2. Deprecated, will print warnings if you use it<-- probably
not 4.x
3. Removed, will fail with undefined method or similar errors

~Ryan

On Sat, 12 Sep 2015 at 20:53 Charles Dumas  wrote:

> I'm sorry if this has been discussed somewhere, but I can't seem to find
> it with google:
>
> I noticed the domain module is marked as deprecated in 4.0.0 :
> https://nodejs.org/api/domain.html
>
> The documentation isn't clear about what users should move to instead of
> domains, just that they should be ready to move:
>
> "This module is pending deprecation. Once a replacement API has been
> finalized, this module will be fully deprecated. Most end users should not
> have cause to use this module. Users who absolutely must have the
> functionality that domains provide may rely on it for the time being but
> should expect to have to migrate to a different solution in the future."
>
> Am I missing something or shouldn't a solution / replacement be available
> before declaring something deprecated?
>
>
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/ff8ae14c-e051-4c64-9793-1fcafe4143a2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAGjmZGwWg-h4NaDFHSeBF6c-y%2BO74VxsLTri%3D9jn6RUWt-oSkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Domain module in nodejs 4.0.0

2015-09-13 Thread Charles Dumas
I tend to agree on no longer using domains and just trying to restart the 
process gracefully. The documentation seemed to imply that a new solution 
was already in the works and I was curious as to what that solution was. 

Thanks everyone for the answers

On Sunday, September 13, 2015 at 11:14:01 AM UTC-4, Brian Deitte wrote:
>
> Here is the PR that made the change:
>
> https://github.com/nodejs/node/pull/141
>
> And here's an expanded explanation:
>
> https://github.com/nodejs/node/pull/141#commitcomment-8951851
>
> While not ideal, I can understand deprecating if you know a different 
> solution is needed, even if that solution isn't available.  I've stayed 
> away from domains myself as I've seen bits and pieces of details through 
> the years on issues using them and in the implementation of them.
>
> On Sat, Sep 12, 2015 at 11:37 PM, Charles Dumas  > wrote:
>
>> I'm sorry if this has been discussed somewhere, but I can't seem to find 
>> it with google:
>>
>> I noticed the domain module is marked as deprecated in 4.0.0 : 
>> https://nodejs.org/api/domain.html
>>
>> The documentation isn't clear about what users should move to instead of 
>> domains, just that they should be ready to move:
>>
>> "This module is pending deprecation. Once a replacement API has been 
>> finalized, this module will be fully deprecated. Most end users should not 
>> have cause to use this module. Users who absolutely must have the 
>> functionality that domains provide may rely on it for the time being but 
>> should expect to have to migrate to a different solution in the future."
>>
>> Am I missing something or shouldn't a solution / replacement be available 
>> before declaring something deprecated?
>>
>>
>>
>> -- 
>> Job board: http://jobs.nodejs.org/
>> New group rules: 
>> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
>> Old group rules: 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to nodejs+un...@googlegroups.com .
>> To post to this group, send email to nod...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/nodejs/ff8ae14c-e051-4c64-9793-1fcafe4143a2%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/c264aef6-768d-445d-a789-69642445f550%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Possible to select globally installed module over locally install one?

2015-09-13 Thread Ryan Schmidt
On Sep 13, 2015, at 03:21, Zlatko wrote:
> 
> What do you mean, they're not requireable?

Probably means that globally installed modules are not intended to be used in a 
require statement, and users should not attempt to find a way to do so.  

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/886F4430-16B6-4ACF-89CF-3B4532CC692F%40ryandesign.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Possible to select globally installed module over locally install one?

2015-09-13 Thread Sam Roberts
On Sun, Sep 13, 2015 at 1:21 AM, Zlatko  wrote:
> What do you mean, they're not requireable?

They aren't.

> [zlatko@zlatko-mint /tmp]$ npm i -G express
> \
> [...cut...]

You misspelled -g as -G, npm ignored you, and installed it locally. :-)

Do an "ls node_modules/express", and you will see.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CACmrRmTesWe%3DDfS9AvRgT1bX8dvryPM1UJUMDj%3DJfQTbCDtPjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Node/Express best practice regarding multiple apps on 1 instance

2015-09-13 Thread Ryan Schmidt

On Sep 9, 2015, at 8:53 AM, Aaron Martone wrote:

> And for clarification, what you're saying about the Node/App side of things, 
> can you throw me a hint or 2 about some tech used for more automated 
> assurances to run my apps? Are we talking about things like Forever, or 
> services that work to constantly ensure that if the Node process dies, it is 
> spun back up without my need to manually do it?

If you're just testing a node app, you can start it on the command line, no 
problem.

If you want that app to run a production web site, you'll want to take care of 
two things:

1. starting your node app when the your boots (even if you don't plan to reboot 
your vps ever, it might reboot for reasons outside of your control, including 
the whims of your hosting provider and unexpected power loss)

2. restarting your node app if it quits (most node apps are designed to quit 
when they encounter an unexpected situation, and also your app might crash)

On OS X, launchd would handle both of those things, if asked to do so via a 
config file (plist) that you would write. On Linux variants that use systemd, 
it would handle both, again if so configured. AFAIK the majority of Linux 
variants do not use systemd, so you may need to handle these two things 
separately, using whatever facilities are built into your flavor of Linux, or 
using other tools. I don't use Linux so I can't guide you specifically.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/A1310D89-008C-4E95-A1E6-07996A3734EC%40ryandesign.com.
For more options, visit https://groups.google.com/d/optout.