【发布时间】:2018-12-12 16:51:18
【问题描述】:
`NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`
remote: npm ERR! Exit status 254
remote: npm ERR!
remote: npm ERR! Failed at the walking-bucket@1.0.0 heroku-postbuild script.
这是我尝试将我的 express/React 应用程序部署到 heroku 时遇到的错误,有什么想法吗?
编辑:带有构建脚本的 package.json:
{
"name": "walking-bucket",
"version": "1.0.0",
"description": "basketball shot journal log",
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^3.0.2",
"bcrypt-nodejs": "0.0.3",
"body-parser": "^1.18.3",
"concurrently": "^4.1.0",
"express": "^4.16.4",
"express-session": "^1.15.6",
"mongoose": "^5.3.14",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^5.0.1"
},
"devDependencies": {
"nodemon": "^1.18.7"
}
}
【问题讨论】:
-
你的
build命令是什么样子的? -
@AnonymousSB 已编辑帖子!
-
你从你的 heroku-postbuild 脚本调用 npm run build ,但你实际上没有构建脚本,这似乎是个问题。
-
不客气,很高兴我能提供帮助
标签: node.js reactjs git express heroku