首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CircleCI:使用nodejs版本12

CircleCI:使用nodejs版本12
EN

Stack Overflow用户
提问于 2021-09-07 11:35:48
回答 1查看 644关注 0票数 2

提供了我的CircleCI文件:

代码语言:javascript
复制
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?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-10 03:57:42

我认为问题出在orbs上,因为在我更新到node: circleci/node@4.7.0之后,我在NodeJS安装和构建项目方面没有任何问题。

这是有意义的,因为cI/CD管道不会运行软件,因此,NodeJS版本应该是无关紧要的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69087538

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档