4 ms·
Yes, there should be a warning that this REMOVES ALL YOUR EXISTING PACKAGES. Make a list of what is already installed before installing this version of npm.
by lazyjeff 15y ago
Yes, there should be a warning that this REMOVES ALL YOUR EXISTING PACKAGES. Make a list of what is already installed before installing this version of npm.
- IsaacSchlueter 15y agoThere was such a warning originally, but it didn't wait to ask you if you wanted to continue. Now it does. The problem with just automatically re-installing those is that npm 0.x only had a global install space, and that was typically used for modules that were loaded via require(). In npm 1.0, you put require()-able modules in the ./node_modules in your project (local install), and you usually want to install CLI apps globally, so that their bins end up in /usr/local/bin. The 'npm link' command puts packages in the global space, and then symlinks them locally. See `npm help folders` for more info on the differences. There's no way for the install script to know what you were doing with each of those. Just cat'ing the list to `xargs npm install` isn't very helpful, because that's going to just install them in ./node_modules. What you really want to do is use your human brain to split that list into two lists, and decide where each item should go.