On Monday, October 22, 2012 12:39:41 AM UTC+2, Martin Cooper wrote:
>
> > That is until I hit some packages that just *must* use a different 
> (usually 
> > older) version of NodeJS than the one which I'm using. 
>
> In many cases, the package author just needs a nudge to get the 
> compatibility spec updated. That said, note that the newest versions 
> of npm treat an engine mismatch as a warning rather than an error, so 
> you may be able to ignore it, assuming the package actually works. 
>

Thanks for the quick reply. Yes, I realize that progress is change, but 
there are some projects out there that simply seem to be too heavily 
invested in older versions of node (the Cloud9 IDE comes to mind) to keep 
bugging the developers to update their code. (There are already a bazillion 
update requests on the C9 issue tracker, and they're being closed almost as 
quickly as they're opened, it seems.)
 

> If you've tried that, and it's not happening (and you need to use an 
> old version of npm for some reason), it's possible that the package is 
> unmaintained or obsolete. In that case, you don't want to be using it 
> anyway. 
>

Sometimes there simply aren't any comparable alternatives (yes, C9 again). 
 

> If the package really is tied to a specific version of Node, that 
> could be because it's no longer needed in later versions, or it's 
> something that will take work to make compatible with newer versions 
> of Node. In this case, you're either stuck, or in for some additional 
> work, if you want to take it on yourself. 
>

Well, that's the very purpose of my proposal: to make it easier to run 
scripts in the version of node they require.
  

> That said, if you feel you really need to build a check into your app, 
> you can do that very simply, unless I'm missing what you're trying to 
> do: 
>
> if (!require('semver').satisfies(process.version, MY_VER_RANGE)) { 
>     console.error("Incompatible Node.js version"); 
>     process.exit(1); 
> } 
>

That's a very interesting example, I didn't know about the 'semver' module, 
I think I can work from this. Thanks.
Now I only need to find out how to maintain different node versions and 
their associated packages (in case there are incompatible (binary) modules 
or libraries involved.
Anyway, as you said, I've got work to do :-)

Kind regards, Alain

-- 
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