I am using Colyseus for my multiplayer game. The framework generated a typescript server which I tried to deploy to Heroku. I am getting the following error in my logs:
2019-08-18T09:45:55.362304+00:00 app[web.1]: npm ERR! syscall spawn
2019-08-18T09:45:55.363375+00:00 app[web.1]: npm ERR! [email protected] start: `ts-node index.ts`
2019-08-18T09:45:55.363477+00:00 app[web.1]: npm ERR! spawn ENOENT
2019-08-18T09:45:55.363677+00:00 app[web.1]: npm ERR!
2019-08-18T09:45:55.363800+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2019-08-18T09:45:55.363912+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-08-18T09:45:55.373038+00:00 app[web.1]:
2019-08-18T09:45:55.373380+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-08-18T09:45:55.373520+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-08-18T09_45_55_365Z-debug.log
My package.json
:
{
"name": "my-app",
"version": "1.0.0",
"description": "npm init template for bootstraping an empty Colyseus project",
"main": "lib/index.js",
"scripts": {
"start": "ts-node index.ts",
"loadtest": "colyseus-loadtest loadtest/example.ts --room my_room --numClients 2",
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "UNLICENSED",
"bugs": {
"url": "https://github.com/colyseus/create-colyseus/issues"
},
"homepage": "https://github.com/colyseus/create-colyseus#readme",
"devDependencies": {
"@colyseus/loadtest": "^0.10.1",
"@types/express": "^4.16.1",
"ts-loader": "^5.3.3",
"ts-node": "^8.1.0",
"typescript": "^3.4.5"
},
"dependencies": {
"@colyseus/monitor": "^0.10.0",
"@colyseus/social": "^0.10.2",
"colyseus": "^0.10.7",
"express": "^4.16.4",
"express-jwt": "^5.3.1"
}
}
This is the tsconfig.json
:
{
"compilerOptions": {
"outDir": "lib",
"target": "es6",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"experimentalDecorators": true
}
}
Why can't Heroku find ts-node
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…