提供了我的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。
在安装期间,有没有更简单的方法来使用特定版本的Node?
发布于 2021-09-10 03:57:42
我认为问题出在orbs上,因为在我更新到node: circleci/node@4.7.0之后,我在NodeJS安装和构建项目方面没有任何问题。
这是有意义的,因为cI/CD管道不会运行软件,因此,NodeJS版本应该是无关紧要的。
https://stackoverflow.com/questions/69087538
复制相似问题