2017-09-19 14:47:10 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-04-10 15:36:59 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2022-07-12 14:15:38 +00:00
|
|
|
export NODE_VERSION=14.19.2
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
# Install NVM for simple node.js version management
|
2020-11-03 02:32:37 +00:00
|
|
|
curl -sSL --fail -o- https://raw.githubusercontent.com/creationix/nvm/v0.36.0/install.sh | bash
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
# This enables NVM without a logout/login
|
2021-01-13 15:56:25 +00:00
|
|
|
export NVM_DIR="${HOME}/.nvm"
|
2017-09-19 14:47:10 +00:00
|
|
|
# shellcheck source=/dev/null
|
|
|
|
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
|
|
|
|
|
|
|
|
# Install Node, Ember CLI, and Phantom for UI development
|
2020-11-13 16:33:07 +00:00
|
|
|
# Use exact full version version (e.g. not 12) for reproducibility purposes
|
2022-07-12 14:15:38 +00:00
|
|
|
nvm install "${NODE_VERSION}"
|
|
|
|
nvm alias default "${NODE_VERSION}"
|
|
|
|
|
|
|
|
# Remove any other version of node installed
|
|
|
|
find ~/.nvm/versions/node -not -name "v${NODE_VERSION}" -depth 1 -exec rm -rf {} \;
|
|
|
|
|
2018-06-11 22:54:43 +00:00
|
|
|
npm install -g ember-cli
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
# Install Yarn for front-end dependency management
|
2020-11-03 02:32:37 +00:00
|
|
|
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.5
|