【发布时间】:2021-09-07 11:35:48
【问题描述】:
提供了我的 CircleCI 文件:
version: 2.1
orbs:
node: circleci/node@4.1.0
aws-cli: circleci/aws-cli@2.0.3
eb: circleci/aws-elastic-beanstalk@2.0.1
jobs:
build:
docker:
- image: "cimg/base:stable"
steps:
- node/install
- checkout
- aws-cli/setup
- eb/setup
- run:
name: Check current version of node
command: node -v
- run:
name: Get and install node version manager.
command: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
- run:
name: Install Node version 12 using NVM
command: nvm install 12
- run:
name: Use Node version 12
command: nvm use 12
- run:
name: Back-End Install
command: |
npm run backend:install
- run:
name: Front-End Install
command: |
npm run frontend:install
- run:
name: Back-End Build
command: |
npm run backend:build
- run:
name: Front-End Build
command: |
npm run frontend:build
- run:
name: Back-End Deploy
command: |
npm run backend:deploy
- run:
name: Front-End Deploy
command: |
npm run frontend:deploy
在安装过程中,CircleCI 安装节点版本为v16.9.0,我需要使用v12。因此,我运行附加命令以使用 NVM 使用 v12。
在设置期间是否有更简单的方法来使用特定版本的节点?
【问题讨论】:
-
什么是节点版本?你能试试
nvm list显示本地安装的版本吗@Arefe -
我想在 CircleCI 中使用 nodejs 版本 12。请参阅
config.yml文件 -
@Batuhan 我认为问题出在球体上