我正在开发已部署到heroku的Node js应用程序,但该应用程序继续崩溃并出现以下错误:
2018-11-26T02:07:50.379980+00:00 app[web.1]: npm ERR! A complete log of this
run can be found in:
2018-11-26T02:07:50.380124+00:00 app[web.1]: npm ERR!
/app/.npm/_logs/2018-11-26T02_07_50_360Z-debug.log
2018-11-26T02:07:50.549195+00:00 heroku[web.1]: State changed from starting
to crashed
2018-11-26T02:09:17.695344+00:00 heroku[web.1]: State changed from crashed
to starting
2018-11-26T02:09:19.540948+00:00 heroku[web.1]: Starting process with
command `npm start`
2018-11-26T02:09:21.646481+00:00 app[web.1]: npm ERR! missing script: start
2018-11-26T02:09:21.654942+00:00 app[web.1]:
这是我的package.json脚本:
"scripts": {
"start": "npm run build && nodemon --exec babel-node ./dist/server.js",
"test": "npm run build && mocha --timeout 10000 ./dist/test/",
"babel-node": "babel-node --presets=env",
"build": "babel src --out-dir dist",
"heroku-postbuild": "npm install",
"postinstall": "npm run build"
},
这是我的Procfile:
web: node dist/server.js