Search code examples
node.jsnodejitsu

How can I deploy this application(https://github.com/HenrikJoreteg/SimpleWebRTC) on nodejitsu?


I was trying to deploy this demo application(https://github.com/HenrikJoreteg/SimpleWebRTC) from SimpleWebRTC on nodejitsu. But I got the following error.

On jitsu start

I am getting this error:

info:    Welcome to Nodejitsu nole
info:    jitsu v0.13.18, node v0.10.13
info:    It worked if it ends with Nodejitsu ok
info:    Executing command start
info:    Starting app simplewebrtc
error:   Error running command start
error:   Errors occured while starting the application
error:   Error output from application. This is usually a user error.
error:
error:   module.js:340
error:       throw err;
error:             ^
error:   Error: Cannot find module 'express'
error:       at Function.Module._resolveFilename (module.js:338:15)
error:       at Function.Module._load (module.js:280:25)
error:       at Module.require (module.js:364:17)
error:       at require (module.js:380:17)
error:       at Object.<anonymous> (/opt/run/snapshot/package/server.js:3:15)
error:       at Module._compile (module.js:456:26)
error:       at Object.Module._extensions..js (module.js:474:10)
error:       at Module.load (module.js:356:32)
error:       at Function.Module._load (module.js:312:12)
error:       at Function.Module.runMain (module.js:497:10)
error:
error:   Error starting application. This could be a user error.
error:   info: Running start for app.
error:   info: Reading `package.json`...
error:   info: Starting application...
error:   info: Spawn: start --min-uptime 2000 -o /opt/run/forza.log -- forza -h
multiplex.nodejitsu.com -p 8556 --start-log /opt/run/start.log --app-user nole -
-app-name simplewebrtc -- node server.js
error:   info: `aeternum` pid: 96350
error:   info: Writing pidfile: /root/app.pid
error:   info: Tailing forza log: /opt/run/start.log
error:   info: Tail closing..
error:   info: Success:start
error:

It is working fine on the local machine. And, package.json is also included on deploying. I have tried this on heroku, getting the same error there too.

Thanks


Solution

  • You need to add express in your package.json

      "dependencies": {
        "express":"*",
        "webrtcsupport": "0.7.3",
        "wildemitter": "1.x",
        "socket.io-client": "0.9.16",
        "attachmediastream": "1.0.1",
        "webrtc": "1.11.x",
        "mockconsole": "0.0.1"
      }
    

    Try to use this dependencies in your package.json.