Skip to content

Commit 1fabc29

Browse files
committed
Give better custom failure messages
1 parent 3f7a3d0 commit 1fabc29

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

package/oracledbinstall.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,17 @@ function done(err, alreadyInstalled) {
338338
const installUrl = 'https://oracle.github.io/node-oracledb/INSTALL.html';
339339

340340
if (err) {
341-
packageUtil.error(err.message);
342341
packageUtil.error('NJS-054: Binary build/Release/oracledb.node was not installed.');
343-
packageUtil.error('Looked for pre-built binary package ' + packageUtil.dynamicProps.PACKAGE_FILE_NAME);
344-
packageUtil.error('See Troubleshooting Node-oracledb Installation Problems at ' + installUrl + '#troubleshooting\n');
342+
if (['darwin', 'win32', 'linux'].indexOf(process.platform) < 0) {
343+
packageUtil.error('Pre-built binary packages are not available for platform="' + process.platform + '"');
344+
} else if (process.arch !== 'x64') {
345+
packageUtil.error('Pre-built binary packages are not available for architecture="' + process.arch + '"');
346+
} else if (['46', '48', '57', '59'].indexOf(process.versions.modules) < 0) {
347+
packageUtil.error('Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="' + process.versions.modules + '")');
348+
}
349+
packageUtil.error('Failed to install binary package ' + packageUtil.dynamicProps.PACKAGE_FILE_NAME);
350+
packageUtil.error(err.message);
351+
packageUtil.error('For help see ' + installUrl + '#troubleshooting\n');
345352
process.exit(87);
346353
} else {
347354
let arch;

0 commit comments

Comments
 (0)