Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
384 views
in Technique[技术] by (71.8m points)

node.js - Concurrently JS application pipeline install and build hangs (Express js for server, Create-React-App for Client)

Problem: I have a project with a server (Express Server that handles file uploading and deleting) and client (Front End Create-React-App). The project structure looks like follows:

Root Folder With Server

Client Folder

Each folder has it's own package.json. Server Package.json. Client package.json

I'm trying to build and deploy onto azure however the pipeline hangs on "npm install and build".

It seems like the build succeeds but this phase just hangs. Here is my server.js (the routes are not included) file and yaml file just in case.

I'd appreciate any kind of help. Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Troubleshooting suggestions:

  1. In the case of ensuring that the code in github is consistent with the local code, if an exception occurs, it is recommended to replace the linux platform and redeploy.

  2. It is recommended to use my suggestion to recreate the repository, and then check the Action status in github.

Sum up:

In general, it is more appropriate to use Linux in azure than windows. For example, Linux supports npx, and may also support other packages and commands. When the local code can run normally, there is generally no problem when deploying to github, unless there may be modifications, which we have ignored. So make sure the code is consistent.

General correct deployment steps:

  1. First in the portal, make sure to create a web app application (not a static web app), and select the node environment.

  2. Make sure that the sever program can run normally locally. Create a new repository in github.

    ->git init

    ->git add.

    ->git commit -m'init'

    ->git remote add origin https://github.com/{your name}/newAppname.git

    ->git push -u origin master

  3. Connect in the Portal's Deployment center.

enter image description here

  1. Then check the status of Action in github.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...