Rivero Felipe
Rivero Felipe

Reputation: 187

Error: Cannot find module 'socket.io' when I am making git push

I have been trying to upload a project to a dokku server with the following line.

git push dokku master

So when the project starts to be upload appears this error:

-----> Running pre-flight checks

   For more efficient zero downtime deployments, create a file CHECKS.

   See http://progrium.viewdocs.io/dokku/checks-examples.md for examples

   CHECKS file not found in container: Running simple container check...

-----> Waiting for 10 seconds ...

remote: App container failed to start!!

=====> chat container output:

   > @ start /app
   > node ./doc/node_servers/cobrowsing/server.js
   module.js:339
       throw err;
       ^

   Error: Cannot find module '/usr/local/lib/node_modules/socket.io'
       at Function.Module._resolveFilename (module.js:337:15)
       at Function.Module._load (module.js:287:25)
       at Module.require (module.js:366:17)
       at require (module.js:385:17)
       at Object.<anonymous> (/app/doc/node_servers/cobrowsing/server.js:4:10)
       at Module._compile (module.js:425:26)
       at Object.Module._extensions..js (module.js:432:10)
       at Module.load (module.js:356:32)
       at Function.Module._load (module.js:311:12)
       at Function.Module.runMain (module.js:457:10)
   npm ERR! Linux 3.13.0-57-generic
   npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
   npm ERR! node v5.0.0

   npm ERR! npm  v3.3.6
   npm ERR! code ELIFECYCLE
   npm ERR! @ start: `node ./doc/node_servers/cobrowsing/server.js`
   npm ERR! Exit status 1
   npm ERR! 
   npm ERR! Failed at the @ start script 'node ./doc/node_servers/cobrowsing/server.js'.
   npm ERR! This is most likely a problem with the  package,
   npm ERR! not with npm itself.
   npm ERR! Tell the author that this fails on your system:
   npm ERR!     node ./doc/node_servers/cobrowsing/server.js
   npm ERR! You can get their info via:
   npm ERR!     npm owner ls 
   npm ERR! There is likely additional logging output above.
   npm ERR! Please include the following file with any support request:
   npm ERR!     /app/npm-debug.log

=====> end chat container output

remote: Error response from daemon: Cannot kill container

244766ea68169dfaabcad927484efa546a5c9e7ba100845183a7595120c7668f: Container

244766ea68169dfaabcad927484efa546a5c9e7ba100845183a7595120c7668f is not running

remote: Error: failed to kill containers:

[244766ea68169dfaabcad927484efa546a5c9e7ba100845183a7595120c7668f]

To [email protected]:chat

! [remote rejected] master -> master (pre-receive hook declined)

What can I do to fix this and upload the project?

Upvotes: 1

Views: 1537

Answers (1)

Rodmentou
Rodmentou

Reputation: 1640

Check your package.json file.

Use

npm install socket.io --save 

in the project folder to save the dependencies on the package.json. :)

@EDIT

By author: 'I resolve it, I have to delete the folder "node_modules", and then npm install'

Upvotes: 1

Related Questions