Skip to content

Commit 773a464

Browse files
committed
Enforce the installation of a specific Node version
This will help ensure a consistent major version of Node is installed on each platform.
1 parent 9250d56 commit 773a464

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ commands:
3333
- restore_cache:
3434
key: starwars-server
3535
- checkout
36+
- run:
37+
command: ./scripts/install-node.sh
38+
name: Install Node
3639
- run:
3740
command: ./scripts/install-or-update-starwars-server.sh
3841
name: Install/Update StarWars Server

scripts/install-node.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
touch $BASH_ENV
4+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
5+
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
6+
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
7+
echo nvm install 12 >> $BASH_ENV
8+
echo nvm alias default 12 >> $BASH_ENV
9+
echo nvm use default >> $BASH_ENV

0 commit comments

Comments
 (0)