【问题标题】:/bin/sh: 1: cross-env: not found when i using github actions/bin/sh: 1: cross-env: 在我使用 github 操作时未找到
【发布时间】:2021-09-03 23:06:51
【问题描述】:

我想用 github 操作构建项目。但在“build-for-devtools”步骤中出现错误。工作流程和错误如下。

工作流程:

jobs:
  build:

    runs-on: ubuntu-18.04
    steps:
      - name: setup node.js environment
        uses: actions/setup-node@v2.1.5
        with:
          node-version: 14
          
      - name: install yarn
        run: sudo npm install -g yarn
      
      - name: clone source code
        run: |
          git clone https://github.com/facebook/react.git
          yarn install
          
      - name: build-for-devtools
        run: |
          cd $GITHUB_WORKSPACE/react
          pwd
          yarn build-for-devtools

错误:

Run cd $GITHUB_WORKSPACE/react
/home/runner/work/react-dev-tool-build/react-dev-tool-build/react
yarn run v1.22.10
$ cross-env RELEASE_CHANNEL=experimental yarn build react/index,react-dom,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh --type=NODE && rm -rf build2 && mkdir build2 && cp -r ./build/node_modules build2/oss-experimental/
/bin/sh: 1: cross-env: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 127.

【问题讨论】:

    标签: javascript reactjs github-actions


    【解决方案1】:

    yarn install 之前需要cd react,因为git 将存储库克隆到./react

    【讨论】:

    • 哦,菜鸟的错误。非常感谢。
    猜你喜欢
    • 2020-08-11
    • 1970-01-01
    • 1970-01-01
    • 2019-05-15
    • 2021-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-26
    相关资源
    最近更新 更多