File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
recipes/newrelic/apm/node Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,30 @@ preInstall:
24
24
if [ -z "$ASSERT_NODE_INSTALLED" ] ; then
25
25
exit 1
26
26
fi
27
+
28
+ LOWEST_SUPPORTED_MAJOR_NODE_VERSION=16
29
+ NODEJS_BINARY_PATH=$(command -v node)
30
+ INSTALLED_MAJOR_NODE_VERSION=$($NODEJS_BINARY_PATH -v | awk -F '[^0-9]+' '{ print $2 }')
31
+ if [ "$INSTALLED_MAJOR_NODE_VERSION" -lt "$LOWEST_SUPPORTED_MAJOR_NODE_VERSION" ]; then
32
+ echo "Error: Node.js version not supported. Please upgrade to the latest supported version." >&2
33
+ exit 132
34
+ fi
35
+
27
36
ASSERT_NPM_INSTALLED=$(sudo -i -u $SUDO_USER command -v npm)
28
37
if [ -z "$ASSERT_NPM_INSTALLED" ] ; then
29
38
exit 2
30
39
fi
40
+
31
41
# Only PM2 is supported at this time
32
42
ASSERT_PM2_INSTALLED=$(sudo -i -u $SUDO_USER command -v pm2)
33
43
if [ -z "$ASSERT_PM2_INSTALLED" ] ; then
44
+ echo "Error: PM2 is required to complete installation." >&2
34
45
exit 132
35
46
fi
47
+
36
48
IS_PM2_RUNNING=$(sudo ps aux | grep pm2 | grep -v grep | wc -l)
37
49
if [ $IS_PM2_RUNNING -eq 0 ] ; then
50
+ echo "Error: PM2 not running. Please start PM2 and retry the installation." >&2
38
51
exit 132
39
52
fi
40
53
exit 0
You can’t perform that action at this time.
0 commit comments