【发布时间】:2021-12-27 06:22:54
【问题描述】:
这是我在运行命令 npm ci 以在我的 GitHub 操作文件中安装依赖项时遇到的问题。
我正在开发一个 expo 托管应用程序,并使用 GitHub Actions 作为 CI,每当我将代码推送到 developmemt 分支时触发构建。
这是我的构建脚本:
name: EAS PIPELINE
on:
push:
branches:
- development
workflow_dispatch:
jobs:
build:
name: Install and build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Setup Expo
uses: expo/expo-github-action@v6
with:
expo-version: 4.x
token: ${{ secrets.EXPO_TOKEN }}
expo-cache: true
- name: Install dependencies
run: npm ci
- name: Build on EAS
run: EAS_BUILD_AUTOCOMMIT=${{1}} npx eas-cli build --platform all --non-interactive
这是我在Install dependencies step 面临的问题。
Run npm ci
npm ci
shell: /usr/bin/bash -e {0}
env:
EXPO_TOKEN: ***
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-10-28T15_16_06_934Z-debug.log
Error: Process completed with exit code 1.
【问题讨论】:
-
请不要粘贴屏幕截图,而是显示相关命令及其输出。此外,为此,在您的项目周围有一些关于存在哪些文件的上下文会很有帮助。
-
进行了更改。谢谢@rethab
标签: npm continuous-integration expo github-actions