Skip to content

Commit 7cd5ce6

Browse files
committed
install node and npm
1 parent fd4bc08 commit 7cd5ce6

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ node_modules
2121
package-lock.json
2222
babel.config.js
2323
dist
24-
static
24+
static
25+
node

build-vue-app.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ set -o xtrace
1616
PS4='+ (${BASH_SOURCE[0]##*/} @ ${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
1717

1818
root=$PWD
19+
20+
# no need to export PATH since it is already in the environment: https://unix.stackexchange.com/a/26059/406037
21+
PATH="${root}/node/bin:$PATH"
22+
1923
cd ${root}/vue-app
2024
npm install
2125
npm run build

install.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,29 @@ pip install --requirement ${root}/install/requirements.txt
4444
mkdir --parents ${root}/bin
4545

4646
bash install/jq.sh ${root}
47+
48+
##########################
49+
50+
rm -rf "node"
51+
node_version="v16.4.2"
52+
53+
if [[ ${machine} == 'x86_64' ]]; then
54+
if [[ ${kernel} == 'Darwin'* ]]; then
55+
curl --remote-name "https://nodejs.org/dist/${node_version}/node-${node_version}-darwin-x64.tar.gz"
56+
tar -xf "node-${node_version}-darwin-x64.tar.gz"
57+
rm "node-${node_version}-darwin-x64.tar.gz"
58+
mv "node-${node_version}-darwin-x64" "node"
59+
elif [[ ${kernel} == 'Linux'* ]]; then
60+
curl --remote-name "https://nodejs.org/dist/${node_version}/node-${node_version}-linux-x64.tar.xz"
61+
tar -xf "node-${node_version}-linux-x64.tar.xz"
62+
rm "node-${node_version}-linux-x64.tar.xz"
63+
mv "node-${node_version}-linux-x64" "node"
64+
else
65+
echo 'neither Darwin nor Linux'
66+
exit 1
67+
fi
68+
else
69+
echo 'not x86_64'
70+
exit 1
71+
fi
72+

0 commit comments

Comments
 (0)