I feel like I need to be able to install global npm packages separately into the NVM dir.
$ nvm install v0.11
######################################################################## 100.0%
Now using node v0.11.16
$ node-inspector
Node Inspector v0.9.2
Visit http://127.0.0.1:8080/debug?port=5858 to start debugging.
my node-inspector stopped working!
$ npm update -g
<bunch of updating, succeeds>
Maybe this will help... Nope! still broken. Sigh. Perhaps... node-inspector doesn't work for a v0.11.16 (that's being run on nvm). Perhaps. Who knows. Well, time to abort.
$ nvm use system
Now using system version of node: v0.10.32.
$ node-inspector --version
dyld: lazy symbol binding failed: Symbol not found: _node_module_register
Referenced from: /usr/local/lib/node_modules/node-inspector/node_modules/ws/build/Release/bufferutil.node
Expected in: dynamic lookup
dyld: Symbol not found: _node_module_register
Referenced from: /usr/local/lib/node_modules/node-inspector/node_modules/ws/build/Release/bufferutil.node
Expected in: dynamic lookup
[1] 93845 trace trap node-inspector --version
Okay.... Well.... Shit.
So anyway, at this point I'm not looking for instructions on how to fix. I may well be hosed. The main question here is what am I supposed to do to manage these npm packages which are meant to be command line tools and which have compiled components that appear tied to specific versions? I understand that when I install nvm and incorporate it into my system, my shell is able to switch its $PATH
so that when I call node
and npm
, they will run using the node version I picked.
But it appears as though the global npm packages get put into /usr/local/bin/
somewhere and they're just stuck there and become unable to follow what I do with nvm
-- While it may not be the case for the "theoretically well-behaved node package", in practice (for something like node-inspector
at least) it sure looks like it's liable to gleefully explode when not executed using the node that installed it.
In the meantime I have to basically npm remove -g <package> && npm install -g <package>
any package that I find behaves strangely in this manner, every single time that I want to run that package under a new node version using nvm
.
This seems wrong.
Is it wrong?
And, a corollary to this would be that every time I invoke nvm powers to test some given node.js app with a different version of node, I pretty much should do it by cloning it in a whole new directory and starting fresh, because otherwise I'll probably find out that I will need to rm -rf node_modules && npm install
just to make it function at all...
node-inspector
"wasn't working" possibly because I did not see the firewall prompt that came up. Still this does not invalidate my question. I still experience the dyld bug etc. and I need to take the rather drastic measure of removing and reinstalling (which does recompilation etc) of packages. I want to make this unnecessary by configuring npm -g to use a path relative to the nvm node version. Is this possible?