简体   繁体   中英

npm ERR! Failed during build script on github actions

I have frontend app written in react. I need to deploy it on azure. Moreover i have to use github actions. During building i get this error:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react_with_mobix@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react_with_mobix@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-06-25T18_19_29_860Z-debug.log
Error: Process completed with exit code 1.

My .yml file looks:

name: Build and deploy Node.js app to Azure Web App - uj-ebiznes-front

on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Set up Node.js version
      uses: actions/setup-node@v1
      with:
        node-version: '14.x'

    - name: npm install, build, and test
      run: |
        CI=false npm install
        CI=false npm run build --if-present
    
    - name: 'Deploy to Azure Web App'
      id: deploy-to-webapp
      uses: azure/webapps-deploy@v2
      with:
        app-name: 'app_name'
        slot-name: 'production'
        publish-profile: //there's my secret
        package: .

I have already changed line with run on:

run: |
        CI=false npm install
        CI=false npm run build --if-present

I found some questions on github issues and on stackOverflow where answers indicate on this line. But it didn't help me.

Please, could you help me? Best regards.

For npm error :-

Try with Create a new file inside your(VS) project with .env Then inside the .env file write this following code and save it.

`SKIP_PREFLIGHT_CHECK=true

The above command will help you in resolving the npm error. After successfully create then try to start the npm and check. This can be work for your issue.

Or, For more information about configuring your node.js app to azure web app Refer this MS Doc .

Deploy the node.js app to App Service from your local Git repository to Azure. Click here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM