![](/img/trans.png)
[英]How to upload a full-stack (ReactJS , NodeJS , socketIO) project to github by git bash command line
[英]Failed to deploy a full-stack project with Nodejs in backend and ReactJs in frontend to Heroku
我有一個全棧項目的工作目錄如下所示:
|__ 服務器
|
|__ 客戶
|
|__ 節點模塊
|
|__ 包.json
{
"name": "kmail",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"client": "cd client && npm start",
"server": "cd server && npm start",
"start": "concurrently - kill-others \"npm run server\" \"npm run client\""
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"concurrently": "3.5.1"
}
}
當我在本地運行項目時,它工作正常。 但是,當我將它部署到 Heroku 時,它失敗了,這是我得到的日志:
Starting process with command 'npm start'
concurrently - kill-others "npm run server" "npm run client"
concurrently - kill-others: not found
你知道解決這個問題的任何解決方案嗎? 或者除了 Heroku 之外還有什么主機服務可以幫助解決我的問題? 非常感謝。
好吧,“啟動”腳本應該啟動服務器部分
"start": "node index.js --prefix server"
Heroku 查找“啟動”腳本並實際使用它來運行應用程序。
嘗試更改它,如果錯誤仍然存在,請在此處粘貼整個日志
我認為是--kill-others
不是- kill-others
"start": "concurrently --kill-others \"npm run server\" \"npm run client\""
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.