10 examples of 'npm uninstall global' in JavaScript

Every line of 'npm uninstall global' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
4async function deleteGlobalNpmDependency(req) {
5 const { packageName } = req.params;
6 // delete
7 await executeCommand(null, `npm uninstall ${packageName} -g`, true);
8
9 return packageName;
10}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

197async function uninstall(opts: IUninstallOpts): Promise<IUninstallResult> {
198 const logger = opts.logger;
199 logger.info("Nothing to do");
200 return {};
201}
97export async function uninstall(ctx: MinimalContext): Promise<void> {
98 try {
99 await regDeleteAll(ctx, base);
100 } catch (e) {
101 logger.warn(
102 `Could not register itchio:// as default protocol handler: ${e.stack ||
103 e}`
104 );
105 }
106}
123function _cmdUninstall(names, options, config, cb) {
124 var resultType,
125 packagesExists,
126 result = {};
127
128 if (commandExecution && commandExecution.uninstall) {
129 var uninstall = commandExecution.uninstall;
130
131 resultType = uninstall.resultType;
132 packagesExists = uninstall.packagesExists;
133 } else {
134 resultType = defaultCommandExecution.resultType;
135 packagesExists = true;
136 }
137
138 if (resultType === "success" && packagesExists) {
139 names.forEach(function (name) {
140 result[name] = "/bowertestuser/bower_components/" + name;
141 });
142
143 cb(null, result);
144 } else {
145 cb(bowerError, null);
146 }
147}
18function npmGlobalPath() {
19 return shell.exec('npm config get prefix', {silent:true}).output.replace(/\s+$/g, '') + "/lib/node_modules" ;
20}
9export function installNPMDependencies(ctx: BuildContext) {
10 return new Promise((resolve, reject) => {
11 exec(`npm install`, {
12 cwd: ctx.projectFolder,
13 }, (error, stdout) => {
14
15 if (error === null) {
16 resolve();
17 } else {
18 reject(Error(stdout));
19 }
20 });
21 });
22}
80export async function uninstall(ctx: MinimalContext): Promise<void> {
81 logger.info("Removing shortcut with squirrel");
82 try {
83 await updateRun(ctx, ["--removeShortcut", exeName]);
84 } catch (e) {
85 logger.info(`Could not remove shortcut: ${e.stack || e}`);
86 }
87}
42async install() {
43 console.log('about to install', [this.nameAndVersion], process.cwd())
44 await npm.install([this.nameAndVersion], { save: true, cwd: process.cwd() })
45}
159function uninstall(args) {
160 var modPkg = ribbit.MOD_PREFIX + args;
161 console.log("Uninstalling " + modPkg + "...");
162 ribbit.uninstall(args, function(err) {
163 if (err)
164 exitFatal(err);
165 else
166 console.log('Uninstalled.');
167 });
168}
85function globalInstalls() {
86 if (!program.fuzzy) return npmGlobal().print();
87 if (program.details) return npmGlobal().details();
88
89 (program.preview) ? npmGlobal().fzfPreview(): npmGlobal().fzf();
90}

Related snippets