heroku - 您好,这是我的 package.json 文件。但是 Heroku 告诉我 Application error 应用程序发生错误,无法提供您的页面
问题描述
您好,这是我的 json 文件格式,当我运行 node index.js 时,它在我的本地机器上运行良好。
{
"name": "a-simple-nodejs-website",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node index.js"
},
"author": "Theodore Kelechukwu Onyejiaku",
"license": "ISC"
}
但是 Heroku 告诉我:应用程序错误应用程序发生错误,无法提供您的页面...
解决方案
json 文件中没有启动脚本,因此添加 =>“start”:“node index.js”。傻瓜代码示例如下
{
"name": "a-simple-nodejs-website",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node index.js",
"start": "node index.js"
},
"author": "Theodore Kelechukwu Onyejiaku",
"license": "ISC"
}
推荐阅读
- angular - 如何为用户登录数据创建存根数据
- python - 使用多线程时如何正确处理此错误
- javascript - 如何在Angular中用空项目填充数组
- c# - Editorconfig:如何获取所有使用 `public` 的警告
- html - 如何在 Vue 中通过 v-for 生成列表
- javascript - 在 MongoDB 中,如何一次检索一个集合中的所有文档?
- symfony - Symfony + Api 平台:没有为帐户“App\Document\Users\User”配置编码器
- reactjs - 如何在 React 中链接到另一个页面?
- spring-boot - 每个 HTTPS 入口请求的 404 NOT FOUND 响应
- arrays - MEX 大于或等于 k 的最小长度子数组