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
heroku部署期间无法将cd放入文件夹_Heroku - Fatal编程技术网

heroku部署期间无法将cd放入文件夹

heroku部署期间无法将cd放入文件夹,heroku,Heroku,我正在尝试将我的MERN堆栈部署到Heroku,但是当我尝试“git push Heroku master”时出现了一个错误,它说“sh:1:cd:can-cd-to../react-front”。 我的文件夹“app”有两个文件夹:“node api”和“react front”。在节点api package.json文件中,我有一行“heroku postbuild”:“cd../react front&&npm install&&npm run build” 这就产生了这个错误。如何修复此

我正在尝试将我的MERN堆栈部署到Heroku,但是当我尝试“git push Heroku master”时出现了一个错误,它说“sh:1:cd:can-cd-to../react-front”。 我的文件夹“app”有两个文件夹:“node api”和“react front”。在节点api package.json文件中,我有一行“heroku postbuild”:“cd../react front&&npm install&&npm run build”
这就产生了这个错误。如何修复此问题?

试试看:
npm运行部署:完整版

    "scripts": {
        "build:ui": "cd ../react-front && npm install && npm run build",
        "deploy": "git push heroku master",
        "deploy:full": "npm run build:ui && git add . && git commit -m uibuild && npm run deploy"
    }

不要更改heroku默认值
生成
命令

尝试:
npm运行部署:完整

    "scripts": {
        "build:ui": "cd ../react-front && npm install && npm run build",
        "deploy": "git push heroku master",
        "deploy:full": "npm run build:ui && git add . && git commit -m uibuild && npm run deploy"
    }

不要更改heroku默认值
生成
命令

尝试
“cd./react front
而不是
”cd../react-front
如果当前文件夹包含名为
react-font
的文件夹,则不希望向上移动文件夹结构。但是package.json位于节点api文件夹中,因此我不必向上移动一步,然后进入react-front。在终端上,它工作正常我刚试过“cd./react front”,但它仍然给出相同的错误try
“cd./react front
而不是
”cd../react-front
如果当前文件夹包含名为
react-font
的文件夹,则不希望向上移动文件夹结构。但是package.json位于节点api文件夹中,因此我不必向上移动一步,然后进入react-front。在终端上,它工作正常。我刚刚尝试了“cd./react front”,但仍然出现相同的错误