Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
推送被拒绝,未能编译Node.js应用程序(使用Reactjs)_Reactjs_Heroku_Deployment - Fatal编程技术网

推送被拒绝,未能编译Node.js应用程序(使用Reactjs)

推送被拒绝,未能编译Node.js应用程序(使用Reactjs),reactjs,heroku,deployment,Reactjs,Heroku,Deployment,我正在尝试将react应用程序部署到Heroku,但我不断收到错误“Push被拒绝,未能编译Node.js应用程序” 我回顾了我部署到Heroku的另外两个react应用程序,看看我是否忘记添加任何内容,我没有发现任何差异。我看到它说它找不到index.html文件,但我看到它在那里。然后我看到了一些关于“失败”的东西portfolio@.1.0建造” 这是我的package.json文件 { "name": "portfolio", "version": "0.1.0", "private":

我正在尝试将react应用程序部署到Heroku,但我不断收到错误“Push被拒绝,未能编译Node.js应用程序”


我回顾了我部署到Heroku的另外两个react应用程序,看看我是否忘记添加任何内容,我没有发现任何差异。我看到它说它找不到index.html文件,但我看到它在那里。然后我看到了一些关于“失败”的东西portfolio@.1.0建造”

这是我的package.json文件

{
"name": "portfolio",
"version": "0.1.0",
"private": true,
"engines": {
"npm": "6.9.0",
"node": "10.16.0"
},
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-icons": "^3.7.0",
"react-router": "^2.0.1",
"react-router-dom": "^5.0.1",
"react-scripts": "3.1.1",
"react-scroll": "^1.7.13"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
  ">0.2%",
  "not dead",
  "not op_mini all"
],
"development": [
  "last 1 chrome version",
  "last 1 firefox version",
  "last 1 safari version"
]
}
}

我只是想知道为什么我不能部署。

“我看到它说它找不到index.html文件,但我看到它在那里。”你怎么看它在那里?它被跟踪了吗?它是否位于存储库根目录中名为
public/
的目录中?文件的大小写是否与直接匹配?我的意思是我可以看到CreateReact应用程序自动为您创建的公用文件夹中的index.html文件。然而,我只是决定制作一个新的react应用程序,只是从旧应用程序复制了代码,它部署得很好。我猜是文件结构的问题。
{
"name": "portfolio",
"version": "0.1.0",
"private": true,
"engines": {
"npm": "6.9.0",
"node": "10.16.0"
},
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-icons": "^3.7.0",
"react-router": "^2.0.1",
"react-router-dom": "^5.0.1",
"react-scripts": "3.1.1",
"react-scroll": "^1.7.13"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
  ">0.2%",
  "not dead",
  "not op_mini all"
],
"development": [
  "last 1 chrome version",
  "last 1 firefox version",
  "last 1 safari version"
]
}
}