Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Action Crash on build

I'm really new to the world of DevOps and want to dip my toes in the water. That's why I've been trying to set up a simple GitHub Action where my site automatically gets deployed to Firebase when I push to master but something goes wrong during the build phase:

Run npm run build
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/runner/work/ChezMout/ChezMout/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/runner/work/ChezMout/ChezMout/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2020-01-12T12_04_27_341Z-debug.log
##[error]Process completed with exit code 254.

This is my basic workflow:

name: Build and Deploy
on:
  push:
    branches:
      - master

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Install Dependencies
        run: npm install
      - name: Build 
        run: npm run build

  deploy:
    name: Deploy
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to Firebase
        uses: w9jds/[email protected]
        with:
          args: deploy
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
          PROJECT_ID: chez-mout

Is there something I'm doing blatantly wrong?

like image 912
Mout Pessemier Avatar asked Jan 12 '20 12:01

Mout Pessemier


1 Answers

npm install is unable to find the package.json file. Please make sure it exists in the root folder of your repository. (And is under version control and valid).

like image 118
scthi Avatar answered Oct 17 '22 06:10

scthi