Skip to content

Commit b1e84ea

Browse files
committed
remove npm library from package.json and add callback functions
1 parent b9d6d96 commit b1e84ea

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

bin/helpers/packageInstaller.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,19 @@ const setupPackageFolder = (runSettings, directoryPath) => {
5353
const packageInstall = (packageDir) => {
5454
return new Promise(function (resolve, reject) {
5555
nodeProcess = spawn('npm', ['install'], {cwd: packageDir});
56-
nodeProcess.on('close', (code) => {
56+
const nodeProcessCloseCallback = (code) => {
5757
if(code == 0) {
5858
resolve('Packages were installed');
5959
} else {
6060
reject('Packages were not installed');
6161
}
62-
});
63-
nodeProcess.on('error', (error) => {
62+
};
63+
const nodeProcessErrorCallback = (error) => {
6464
logger.error(`Some error occurred while installing packages: ${error}`);
6565
reject('Packages were not installed');
66-
});
66+
};
67+
nodeProcess.on('error', nodeProcessErrorCallback);
68+
nodeProcess.on('close', nodeProcessCloseCallback);
6769
});
6870
};
6971

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"uuid": "^8.3.2",
2727
"winston": "^2.3.1",
2828
"yargs": "^14.2.3",
29-
"npm": "^6.14.15",
3029
"axios": "^0.21.1",
3130
"unzipper": "^0.10.11",
3231
"update-notifier": "^5.1.0"

0 commit comments

Comments
 (0)