@pdftron/pdfnet-node 11.9.0 → 11.10.0-2-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/install.js +16 -1
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -18,8 +18,23 @@ if (isElectron) {
|
|
|
18
18
|
|
|
19
19
|
console.log('Downloading prebuilt binary from:', prebuildUrl);
|
|
20
20
|
|
|
21
|
+
function npmSupportsExec() {
|
|
22
|
+
try {
|
|
23
|
+
const version = execSync('npm --version', { encoding: 'utf8' }).trim();
|
|
24
|
+
const major = Number(version.split('.')[0]);
|
|
25
|
+
return major >= 7;
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
try {
|
|
22
|
-
|
|
32
|
+
if (npmSupportsExec()) {
|
|
33
|
+
execSync(`npm exec prebuild-install -- --download ${prebuildUrl} --verbose`, { stdio: 'inherit' });
|
|
34
|
+
} else {
|
|
35
|
+
console.log("npm exec not found, falling back to npx")
|
|
36
|
+
execSync(`npx prebuild-install --download ${prebuildUrl} --verbose`, { stdio: 'inherit' });
|
|
37
|
+
}
|
|
23
38
|
|
|
24
39
|
const extractedFolder = `node-v${abi}-${platform}-${arch}`;
|
|
25
40
|
const libFolder = path.join(extractedFolder, 'lib');
|