mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
Fix install specific version
Like: `pm2 install module@2.1.0-beta` Remove `force` option from rm, not needed and dangerous
This commit is contained in:
parent
5c0b57826b
commit
df62d2ceca
@ -145,6 +145,10 @@ function installModule(module_name, cb) {
|
||||
|
||||
if (module_name.indexOf('/') != -1)
|
||||
module_name = module_name.split('/')[1];
|
||||
|
||||
//pm2 install module@2.1.0-beta
|
||||
if(module_name.indexOf('@') != -1)
|
||||
module_name = module_name.split('@')[0]
|
||||
|
||||
proc_path = p.join(cst.PM2_ROOT_PATH, 'node_modules', module_name);
|
||||
|
||||
@ -174,14 +178,14 @@ function uninstallModule(module_name, cb) {
|
||||
|
||||
if (module_name != '.') {
|
||||
console.log(proc_path);
|
||||
shelljs.rm('-rf', proc_path);
|
||||
shelljs.rm('-r', proc_path);
|
||||
}
|
||||
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
if (module_name != '.') {
|
||||
shelljs.rm('-rf', proc_path);
|
||||
shelljs.rm('-r', proc_path);
|
||||
}
|
||||
|
||||
return cb();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user