Using npm, how do you uninstall a package?
Experience Level:
Junior
Tags:
npm
Answer
If you want to uninstall a local npm package, open a command-line, go to your project directory that contains a file package.json and run the following command:
npm uninstall <package-name>
To uninstall a global npm package, open a command-line, go to your project directory that contains a file package.json and run the following command:
npm uninstall -g <package-name>
Related npm job interview questions
-
Using npm, how do you list installed modules?
npm Junior -
Using npm, how do you check if there is a newer version of some the project package?
npm Mid-level -
Where can you find modules that the npm installed locally after you executed the npm install command?
npm Junior -
What does npm init command do and when would you use it?
npm Junior -
What information is stored about every dependency in the npm file package.json?
npm Junior