I uninstalled npm; how do I reinstall?

95 views
Skip to first unread message

wgw

unread,
Jun 8, 2014, 6:23:16 PM6/8/14
to nod...@googlegroups.com
My npm was corrupt, so I uninstalled it (in Ubuntu : sudo npm uninstall npm -g). Originally, I had installed it from sources (using sudo) and then updated nodejs with npm, but I think the update may have left npm in a corrupt state. At any rate, I had problems using npm install with or without sudo.

What is the best option? Should I try to reinstall npm or just start all over again, with a new install of nodejs? Without npm, it is hard to know where everything is installed! But I do have the original src. Could I do a sudo make uninstall in the src directory (as suggested here: https://github.com/npm/npm)

Darren

unread,
Jun 9, 2014, 11:17:02 AM6/9/14
to nod...@googlegroups.com
You can 'sudo apt-get install npm', or you can reinstall node from source.

Note, when you install from deb or rpm packages, they can place npm in a different location than when you build and install from source. For example on rhel, the rpm installs it to /usr/bin/npm whereas building from source will put it under /usr/local/bin/npm.

Unless you need to deploy lots of servers in a more-or-less automated way, I'd recommend reinstalling node from the source tarball and then 'sudo npm install n' for node version management. Or if you prefer, the nvm node version manager.

greelgorke

unread,
Jun 10, 2014, 3:22:39 AM6/10/14
to nod...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages