Github操作:[!]错误:找不到模块'rollup-plugin-commonjs'

时间:2020-04-30 06:38:57

标签: github github-actions building-github-actions

在我的package.json中,有rolluprollup-plugin-commonjs 但是在github动作中,它找不到那些包!

如果我没有在github-action的全局软件包安装步骤中添加汇总,则表明未找到rollup。但是在添加汇总和rollup-plugin-commonjs后,我得到了[!] Error: Cannot find module 'rollup-plugin-commonjs'

这是我的工作流程文件:

name: Github Action
on:
  push:
    branches:
      - fix/auto-test

jobs:
  test:
    runs-on: ubuntu-18.04


    steps:
      - uses: actions/checkout@v1
      - name: Bootstrap app on Ubuntu
        uses: actions/setup-node@v1
        with:
          node-version: '11.x.x'
      - name: Install global packages
        run: npm install -g prisma rollup rollup-plugin-commonjs

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - name: Cache Project dependencies test
        uses: actions/cache@v1
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - name: Install project deps
        if: steps.yarn-cache.outputs.cache-hit != 'true'
        run: yarn

      - name: Run docker
        run: docker-compose -f docker-compose.test.prisma.yml up --build -d

      - name: Sleep
        uses: jakejarvis/wait-action@master
        with:
          time: '30s'

      - name: Reset the database for safety
        run: yarn reset:backend

      - name: Deploy
        run: yarn deploy:backend

      - name: Build this great app
        run: yarn build

      - name: start app and worker concurrently and create some instances
        run: |
          yarn start &
          yarn start:worker &
          xvfb-run --auto-servernum yarn test:minimal:runner


0 个答案:

没有答案