how-to-npm icon indicating copy to clipboard operation
how-to-npm copied to clipboard

The first test nukes NPM

Open abjbhat opened this issue 9 years ago • 4 comments

I ran how-to-npm verify for the very first test. When the tool/test found that I have an out of date version, it reported it as so. Of course, after that, I could not find npm on bash. I can verify that npm was installed, because that's how I installed how-to-npm in the first place. sudo or not, it nukes my npm install every time.

I had to reinstall node each time get things working again. Thanks a lot, how-to-npm!

My system details OS X 10.10.3 Node v0.12.4

abjbhat avatar Jun 22 '15 14:06 abjbhat

Did you execute npm install npm -g?

On OS X, because a global install modifies /usr/local/lib, you need root permissions to install globally. Thus, when you try to install npm globally with npm without privilege, it removes your version and goes to get the new one, only to find it can't install it globally (doesn't have adequate permissions). The easy fix is to instead run sudo npm install npm -g. It will prompt you to type in your password (your password will not show up in the terminal window, but don't worry, it's there) and you'll be golden. You usually have to use sudo to install any module globally with npm on OS X.

ericmarkmartin avatar Jun 24 '15 02:06 ericmarkmartin

Eric,

Each time that I ran how-to-npm verify, npm would vanish from my system. I had to rerun the node dpkg installer to get npm back after attempting the first test.

abjbhat avatar Jun 28 '15 15:06 abjbhat

Eric - I had this problem as well - nuked my node installation when I tried to

npm install npm -g

I didn't do sudo, but I've installed plenty of other npm modules without using sudo. Why is this different?

tad avatar Jul 31 '15 18:07 tad

+1, happened to me also. Luckily I had just installed 4.0.0 :grin:

claudiopro avatar Sep 12 '15 20:09 claudiopro