I checked the haxe official examples. While npm install and npm start worked fine locally. But when I tried to put them on my hosting's Vps it gave me this error:
[root@server colyseus-official-examples]# npm start
colyseus-examples@1.0.1 start /var/www/html/001-codex/colyseus-official-examples
ts-node-dev --respawn --transpile-only src/index.ts
sh: ts-node-dev: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! colyseus-examples@1.0.1 start: ts-node-dev --respawn --transpile-only src/index.ts
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the colyseus-examples@1.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-05-15T09_47_00_680Z-debug.log
Here is the content of log file:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@6.12.0
3 info using node@v12.13.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle colyseus-examples@1.0.1~prestart: colyseus-examples@1.0.1
6 info lifecycle colyseus-examples@1.0.1~start: colyseus-examples@1.0.1
7 verbose lifecycle colyseus-examples@1.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle colyseus-examples@1.0.1~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/html/001-codex/colyseus-official-examples/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
9 verbose lifecycle colyseus-examples@1.0.1~start: CWD: /var/www/html/001-codex/colyseus-official-examples
10 silly lifecycle colyseus-examples@1.0.1~start: Args: [ '-c', 'ts-node-dev --respawn --transpile-only src/index.ts' ]
11 info lifecycle colyseus-examples@1.0.1~start: Failed to exec start script
12 verbose stack Error: colyseus-examples@1.0.1 start: ts-node-dev --respawn --transpile-only src/index.ts
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:210:5)
12 verbose stack at maybeClose (internal/child_process.js:1021:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
13 verbose pkgid colyseus-examples@1.0.1
14 verbose cwd /var/www/html/001-codex/colyseus-official-examples
15 verbose Linux 2.6.32-042stab120.19
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
17 verbose node v12.13.0
18 verbose npm v6.12.0
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error colyseus-examples@1.0.1 start: ts-node-dev --respawn --transpile-only src/index.ts
23 error spawn ENOENT
24 error Failed at the colyseus-examples@1.0.1 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]