Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
We usually set up an npm
bundle as follows:
npm set up <package_name>
However how can we uninstall an npm
bundle?
This may uninstall an npm bundle that was put in in your challenge.
Simply be certain that to run the command from the foundation listing of your challenge.
npm uninstall <package_name>
This may take away the bundle from the node_modules
listing and also will take away the reference to it from the bundle.json
file.
You probably have a bundle put in within the devDependency
part of your bundle.json
, then you’ll be able to uninstall it as follows:
npm uninstall -D <package_name>
Typically we set up npm
packages globally, in order that we are able to use them as command-line instruments, or if we would like them accessible to all initiatives.
This may be achieved as follows:
npm uninstall -g <package_name>
While you uninstall npm
you’re eradicating packages which have beforehand been put in by the npm set up
or npm i
instructions.
If you need to uninstall a selected npm
bundle, then run the next command:
npm uninstall <package_name>
If you need to uninstall a Take away Create React App
:
# npm
npm uninstall -g create-react-app
# yarn
yarn world take away create-react-app
Delete the node
and npm
folders situated there:
# delete node folder
rm -rf /usr/native/bin/node
# delete npm folder
rm -rf /usr/native/bin/npm
As soon as each folders are deleted, you’ll be able to reinstall node and npm utilizing the .pkg
file for Mac.
In the event you set up Node utilizing Homebrew, then you should utilize brew
command to uninstall it:
# uninstall node and npm
brew uninstall node
# set up it once more
brew set up node
In case you are utilizing Linux Ubuntu, then you’ll be able to take away Node utilizing apt-get
as proven beneath:
# uninstall node for Ubuntu
sudo apt-get take away node
# set up it once more
sudo apt-get set up node
In the event you don’t need to uninstall node, then you’ll be able to attempt to obtain and set up npm
instantly utilizing the set up.sh
script from npmjs.com.
Open the terminal and run the next command:
curl -qL https://www.npmjs.com/set up.sh | sh
Usually, you probably have an present npm program put in already, the direct set up will fail as proven beneath:
$ curl -qL https://www.npmjs.com/set up.sh | sh
# ...
# fetching: https://registry.npmjs.org/npm/-/npm-8.13.2.tgz
# eradicating present npm
# failed!
Appears npm direct set up received’t work for some purpose.
It’s essential add the sudo
command to the sh
pipe as proven beneath:
curl -qL https://www.npmjs.com/set up.sh | sudo sh
In the event you’re utilizing ZSH, you might even see the command above suspended like this:
# zsh: suspended (tty enter) sudo sh
When that occurs, attempt to obtain the set up.sh
script first, then run it utilizing the sudo
command as follows:
# obtain set up.sh
curl -O https://www.npmjs.com/set up.sh
# run the script utilizing sudo
sudo sh set up.sh
# after set up full, take away the script
rm set up.sh