upgrade node and upgrade modules?

47 views
Skip to first unread message

Stefano Cudini

unread,
May 21, 2014, 2:43:56 PM5/21/14
to nod...@googlegroups.com
I upgraded nodejs on my system to a new version.

I had already installed many npm packages installed globally with the previous version, inside: /opt/node-v0.old/lib/node_modules 

The new version now say the package is located at: /opt/node-v0.new/lib/node_modules

Is a better way to reinstall all packages with the new version of nodejs? 
or I can simply move node_modules dir to the new path? 

what is the best behavior usually?

Daniel Rinehart

unread,
May 21, 2014, 6:34:41 PM5/21/14
to nodejs

If you frequently run multiple different versions of node on the same machine, many use a version manager like nvm or n to make the task easier. In this case you would install the module globally for each version of node.

In general I would recommend reinstalling global modules. If you instead copy, be sure to do an npm rebuild on each global module to ensure any binary bits are recompiled against the new version of node.

-- Daniel R. <dan...@neophi.com> [http://danielr.neophi.com/]

--
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/43b545a8-ef47-428a-8adf-9a42ff2b18dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aria Stewart

unread,
May 21, 2014, 3:39:03 PM5/21/14
to nod...@googlegroups.com
You can move it if it’s, say, 0.10.11 to 0.10.12 without problem. If it’s 0.10.x to 0.11.x, the ABIs have changed and you’ll need to rebuild modules. If you have no modules written in C++, you’ll be fine.

I’d move it over then “npm rebuild -g” to rebuild any C++ modules.

Aria
signature.asc

Stefano Cudini

unread,
May 22, 2014, 10:49:50 AM5/22/14
to nod...@googlegroups.com


Il giorno giovedì 22 maggio 2014 00:34:41 UTC+2, Daniel R. ha scritto:

If you frequently run multiple different versions of node on the same machine, many use a version manager like nvm or n to make the task easier. In this case you would install the module globally for each version of node.

I already seen these management packages version .. few times ago I used nvm but it was a bit of trouble on the system .. I stopped using it.
Perhaps now 'n' works best?
But anyway of these packages support the automatic rebuilding of all global modules installed?
 

In general I would recommend reinstalling global modules. If you instead copy, be sure to do an npm rebuild on each global module to ensure any binary bits are recompiled against the new version of node.

tnks @Daniel, Unfortunately, I have just a system with so many node_modules dirs scattered around :(

however I'm upgrade from 0.10.12 to 0.10.26... should be no problems, right?

Stefano Cudini

unread,
May 22, 2014, 10:51:13 AM5/22/14
to nod...@googlegroups.com
tnks!!  It's just what I needed


 

Aria Stewart

unread,
May 22, 2014, 11:50:31 AM5/22/14
to nod...@googlegroups.com

On May 22, 02014, at 10:49, Stefano Cudini <stefano...@gmail.com> wrote:
\

In general I would recommend reinstalling global modules. If you instead copy, be sure to do an npm rebuild on each global module to ensure any binary bits are recompiled against the new version of node.

tnks @Daniel, Unfortunately, I have just a system with so many node_modules dirs scattered around :(

however I'm upgrade from 0.10.12 to 0.10.26... should be no problems, right?

Correct. Built the default way or using the binary packages from nodejs.org, binary compatibility is maintained.
signature.asc
Reply all
Reply to author
Forward
0 new messages