repair npm global package symlinks
node.js, npm, osx-mavericks
Solution
Run this to rebuild in place without reinstalling:
for i in "$(npm prefix -g)/lib/node_modules/"*; do
sudo npm build -g "$i"
done
But, are you sure that the symlinks are broken, and not that it simply changed your `PATH` environment variable or something? What does `npm bin -g` output?
Problem
Recently upgraded to OSX Mavericks and had all my npm global module symlinks wiped out! Reinstalling npm got npm to work again. Is there a way to have npm recursively go through /usr/local/lib/node_modules/ and create the symlinks in /usr/local/bin for each package? (yes, it is in my Path) Is there a way to do this a single package at a time? My Google-fu is failing me at the moment. I have over 40 packages and I would hate to have to reinstall all of them or manually create symlinks for all the bins! OSX 10.9 npm 1.4.14 node 0.10.29