|
|
@ -333,7 +333,10 @@ function init:nginx() { |
|
|
function init:nodejs() { |
|
|
function init:nodejs() { |
|
|
log::info "[nodejs]" "安装nodejs环境..." |
|
|
log::info "[nodejs]" "安装nodejs环境..." |
|
|
local host="127.0.0.1" |
|
|
local host="127.0.0.1" |
|
|
local exc_cmd=" |
|
|
command::exec "${host}" " |
|
|
|
|
|
curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - |
|
|
|
|
|
yum -y install nodejs |
|
|
|
|
|
npm install --global yarn |
|
|
# 配置npm源 |
|
|
# 配置npm源 |
|
|
npm config set registry https://registry.npm.taobao.org |
|
|
npm config set registry https://registry.npm.taobao.org |
|
|
npm config set disturl https://npm.taobao.org/dist |
|
|
npm config set disturl https://npm.taobao.org/dist |
|
|
@ -350,17 +353,11 @@ function init:nodejs() { |
|
|
yarn config set operadriver_cdnurl https://cdn.npm.taobao.org/dist/operadriver -g |
|
|
yarn config set operadriver_cdnurl https://cdn.npm.taobao.org/dist/operadriver -g |
|
|
yarn config set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents -g |
|
|
yarn config set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents -g |
|
|
" |
|
|
" |
|
|
command::exec "${host}" " |
|
|
|
|
|
curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - |
|
|
|
|
|
yum -y install nodejs |
|
|
|
|
|
npm install --global yarn |
|
|
|
|
|
$exc_cmd |
|
|
|
|
|
" |
|
|
|
|
|
check::exit_code "$?" "nodejs" "$host 安装nodejs环境" "exit" |
|
|
check::exit_code "$?" "nodejs" "$host 安装nodejs环境" "exit" |
|
|
exc_cmd="$(utils::quote "$exc_cmd")" |
|
|
exc_cmd="$(utils::quote "$exc_cmd")" |
|
|
if [[ "${ADD_USER_TAG:-}" == "1" ]]; then |
|
|
if [[ "${ADD_USER_TAG:-}" == "1" ]]; then |
|
|
command::exec "${host}" " |
|
|
command::exec "${host}" " |
|
|
echo '${ADD_USER_PASSWORD}' | su - ${ADD_USER_NAME} -c $exc_cmd |
|
|
echo '${ADD_USER_PASSWORD}' | su - ${ADD_USER_NAME} -c 'npm config set registry https://registry.npm.taobao.org' |
|
|
" |
|
|
" |
|
|
check::exit_code "$?" "nodejs" "$host nodejs配置" "exit" |
|
|
check::exit_code "$?" "nodejs" "$host nodejs配置" "exit" |
|
|
log::info "[nodejs]" "nodejs配置成功!" |
|
|
log::info "[nodejs]" "nodejs配置成功!" |
|
|
|