@faable/faable 1.4.6 → 1.4.8
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import path__default from 'path';
|
|
3
3
|
import { cmd } from '../../../../lib/cmd.js';
|
|
4
|
+
import { log } from '../../../../log.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Strategy to detect app name from package.json
|
|
@@ -18,8 +19,15 @@ const strategy_nodejs = async (workdir) => {
|
|
|
18
19
|
// Use engines.node if found
|
|
19
20
|
let runtime_version = "18.19.0";
|
|
20
21
|
if (engines?.node) {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
try {
|
|
23
|
+
const check_cmd = `npm view node@"${engines.node}" version | tail -n 1 | cut -d "'" -f2`;
|
|
24
|
+
const out = await cmd(check_cmd);
|
|
25
|
+
runtime_version = out.stdout.toString();
|
|
26
|
+
log.info(`Using node@${runtime_version} from engines in package.json (${engines.node})`);
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
throw new Error(`Node version is not valid (${engines.node})`);
|
|
30
|
+
}
|
|
23
31
|
}
|
|
24
32
|
return {
|
|
25
33
|
app_name: name,
|