获取“某些东西已经在端口

编程入门 行业动态 更新时间:2024-10-05 15:26:48

获取“某些东西已经在<a href=https://www.elefans.com/category/jswz/34/1770903.html style=端口"/>

获取“某些东西已经在端口

我将我的 NodeJS 应用程序部署到 Heroku 没有任何问题,但是当我尝试访问该网站时它没有显示,并且日志显示它是因为应用程序崩溃了。在此之前,它说“某些东西已经在端口 ___ 上运行(数字更改)”,请参阅下面的完整日志。

我没有在任何地方定义端口,所以我不确定是什么导致了这个问题

2023-04-23T01:48:31.153091+00:00 heroku[web.1]:状态从启动变为启动 2023-04-23T01:48:31.985212+00:00 app[web.1]: (node:94) [DEP0111] 弃用警告:不推荐访问 process.binding('http_parser')。 2023-04-23T01:48:31.985224+00:00 app[web.1]:(使用

node --trace-deprecation ...
显示创建警告的位置) 2023-04-23T01:48:31.994899+00:00 app[web.1]:某些东西已经在端口 54962 上运行。 2023-04-23T01:48:32.144102+00:00 heroku[web.1]:进程退出,状态为 0 2023-04-23T01:48:32.215276+00:00 heroku[web.1]:状态从 up 变为 crashed 2023-04-23T01:51:22.767165+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.novacancytrans request_id=807a004d-266d -4b22-8853-0017d0f41a74 fwd="72.207.46.240" dyno=connect=service=status=503 bytes=protocol=http 2023-04-23T01:51:23.584384+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=www.novacancytrans request_id= d216e51a-ac49-4f54-9816-821b430d18fd fwd="72.207.46.240" dyno=connect=service=status=503 bytes=protocol=http

这是我的 package.json

{
"name": "no-vacancy",
"version": "1.0.0",
"main": "server.js",
"engines": {
"node": "16.x",
"npm": "8.x"
},
"scripts": {
"start": "npx if-env NODE_ENV=production && npm run start:prod || npm run start:dev",
"start:prod": "node server.js && cd client/\* & npm run client",
"start:dev": "node server.js && cd client/\* & npm run client",
"client": "cd client && npm run start",
"install": "cd client && npm install",
"build": "cd client && npm run build",
"heroku-postbuild": "npm run build"
},
"author": "",
"license": "ISC",
"devDependencies": {
"bulma": "^0.8.0",
"concurrently": "^8.0.1",
"morgan": "^1.9.1"
},
"dependencies": {
"@material-ui/core": "^4.5.1",
"@material/typography": "^3.1.0",
"ag-grid-react": "28.2.1",
"ag-grid-community": "^28.2.1",
"axios": "^0.19.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"classnames": "^2.2.6",
"concurrently": "^8.0.1",
"dotenv": "^8.1.0",
"express": "^4.17.1",
"formik": "^1.5.8",
"google-map-react": "^1.1.5",
"google-maps-react": "^2.0.2",
"http-proxy-middleware": "^0.20.0",
"if-env": "^1.0.4",
"is-empty": "^1.2.0",
"jsonwebtoken": "^8.5.1",
"jwt-decode": "^2.2.0",
"mapbox-gl": "^1.5.0",
"material-paper": "0.0.8",
"moment": "^2.24.0",
"mongodb": "^3.3.2",
"mongodb-stitch-browser-sdk": "^4.5.0",
"mongoose": "^5.7.5",
"mongoose-geojson-schema": "^2.1.3",
"mongoose-geojson-schemas": "^0.10.13",
"nodemailer": "^6.8.0",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"react": "^16.10.1",
"react-datepicker": "^2.9.6",
"react-dom": "^16.10.2",
"react-google-maps": "^9.4.5",
"react-redux": "^7.1.1",
"react-router-dom": "^5.0.1",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^0.88.2",
"validator": "^11.1.0",
"yup": "^0.27.0"
}
}

简介

web: npm start

Server.js文件末尾有如下代码:

app.get("\*", function(req, res) {
res.sendFile(path.join(\__dirname, "./client/build/index.html"));
});
const PORT = process.env.PORT || 5000;

app.listen(PORT, function() {
console.log(` 
          

更多推荐

获取“某些东西已经在端口

本文发布于:2024-05-28 11:59:54,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:端口   东西

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!