NodeJs Heroku部署在构建上失败

时间:2018-09-30 10:41:04

标签: node.js heroku heroku-cli

我只是想将我的Web应用程序构建到Heroku。我可以在本地“构建”客户端,但是由于某些原因,当我 git push heroku master 时,在Heroku构建客户端时,构建失败...

Module not found: Error: Can't resolve './components/Authentication/login' in '/tmp/build_9709419844244c794729ea02221256db/client/src'

当我运行 npm run build 时,该组件存在并且正在本地构建。我的服务器package.json如下:

{
"name": "server",
"version": "1.0.0",
"description": "This is the server",
"engines": {
"node": "9.8.x"
 },
"main": "index.js",
"scripts": {
"start": "node server",
"heroku-postbuild": "cd client/ && npm install && npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"cacheDirectories": [
"node_modules",
"client/node_modules"
],
"author": "Chris and Patrick",
  "license": "ISC",
  "dependencies": {
"axios": "^0.18.0",
"body-parser": "^1.18.3",
"dotenv": "^6.0.0",
"express": "^4.16.3",
"firebase": "^5.5.0",
"firebase-admin": "^6.0.0",
"jimp": "^0.5.3",
"mime-types": "^2.1.20",
"multer": "^1.4.0",
    "uuid-v4": "^0.1.0"
  }
}

上面是我的主要package.json文件。

我试图清除构建缓存并再次运行生产构建,但收到以下错误:

Cannot run one-off process at this time. Please try again later.

1 个答案:

答案 0 :(得分:0)

我能够解决此问题。

问题是github无法识别文件夹名称的大小写更改。我不得不重命名每个组件文件夹,然后重新推送到heroku master。工作正常。