Repository: Cloud-CV/EvalAI
Issue: Nodejs returned with error code
Root cause: Environment Incompatibility

When I was trying to launch the application via docker-compose, nodejs returned with the following error. 
`
nodejs    | module.js:545
nodejs    |     throw err;
nodejs    |     ^
nodejs    | 
nodejs    | Error: Cannot find module 'run-sequence'
nodejs    |     at Function.Module._resolveFilename (module.js:543:15)
nodejs    |     at Function.Module._load (module.js:470:25)
nodejs    |     at Module.require (module.js:593:17)
nodejs    |     at require (internal/module.js:11:18)
nodejs    |     at Object.<anonymous> (/code/gulpfile.js:5:19)
nodejs    |     at Module._compile (module.js:649:30)
nodejs    |     at Object.Module._extensions..js (module.js:660:10)
nodejs    |     at Module.load (module.js:561:32)
nodejs    |     at tryModuleLoad (module.js:501:12)
nodejs    |     at Function.Module._load (module.js:493:3)
nodejs exited with code 1
`


Sorry for the inconvenience @Jonathan-Livingston-Seagull. We are looking into this issue. We will let you know soon.  

@Jonathan-Livingston-Seagull It might be helpful if you can tell where were you exactly facing this error? Would be nice if you can share the full log. Things will be more clear then. 

@Jonathan-Livingston-Seagull I tested the node container on my system and it seems to work fine for me. Please see the logs below:

```
deshraj at lawn-128-61-35-111 in ~/Documents/evalai on master [?$]
$ docker-compose build nodejs
Building nodejs
Step 1/21 : FROM node:8.11.1
 ---> 4635bc7d130c
Step 2/21 : MAINTAINER EvalAI Team <team@cloudcv.org>
 ---> Using cache
 ---> 3629121c8f20
Step 3/21 : RUN apt-get update -qq && apt-get install -y build-essential git curl libfontconfig
 ---> Using cache
 ---> 324b6d7747d9
Step 4/21 : RUN apt-get update
 ---> Using cache
 ---> 19e37fc95d99
Step 5/21 : RUN mkdir /code
 ---> Using cache
 ---> 309c39577a13
Step 6/21 : ADD ./package.json /code
 ---> Using cache
 ---> 84287d5734bf
Step 7/21 : ADD ./bower.json /code
 ---> Using cache
 ---> 4481066a9cc8
Step 8/21 : ADD ./gulpfile.js /code
 ---> Using cache
 ---> 3163c348a169
Step 9/21 : ADD ./.eslintrc /code
 ---> Using cache
 ---> 0f6663493714
Step 10/21 : ADD ./karma.conf.js /code
 ---> Using cache
 ---> 9eb069bcc281
Step 11/21 : WORKDIR /code
 ---> Using cache
 ---> 8c460a0be5d2
Step 12/21 : RUN npm install -g bower gulp
 ---> Using cache
 ---> 4343e2699dd4
Step 13/21 : RUN npm link gulp
 ---> Using cache
 ---> 5d6a1bb604f8
Step 14/21 : RUN npm cache clean -f
 ---> Using cache
 ---> 71cd0acb432c
Step 15/21 : RUN npm install -g n
 ---> Using cache
 ---> 83ab1a0d071b
Step 16/21 : RUN n stable
 ---> Using cache
 ---> 7c002602b89d
Step 17/21 : RUN npm install
 ---> Using cache
 ---> 2a5cb93a1b20
Step 18/21 : RUN bower install --allow-root
 ---> Using cache
 ---> 7f773c850836
Step 19/21 : ADD . /code
 ---> Using cache
 ---> 7f1f5a745bf7
Step 20/21 : CMD ["gulp", "dev:runserver"]
 ---> Using cache
 ---> ae60d3ba6342
Step 21/21 : EXPOSE 8888
 ---> Using cache
 ---> bf90bf28a371
Successfully built bf90bf28a371
Successfully tagged evalai_nodejs:latest
(env)
deshraj at lawn-128-61-35-111 in ~/Documents/evalai on master [?$]
$ docker-compose up nodejs
Creating network "evalai_default" with the default driver
Creating nodejs ... done
Attaching to nodejs
nodejs               | [16:05:34] Using gulpfile /code/gulpfile.js
nodejs               | [16:05:34] Starting 'dev:runserver'...
nodejs               | [16:05:34] Starting 'dev'...
nodejs               | [16:05:34] Starting 'clean'...
nodejs               | [16:05:34] Finished 'clean' after 208 ms
nodejs               | [16:05:34] Starting 'css'...
nodejs               | [16:05:34] Starting 'js'...
nodejs               | [16:05:34] Starting 'html'...
nodejs               | [16:05:34] Starting 'images'...
nodejs               | [16:05:34] Starting 'vendorjs'...
nodejs               | [16:05:34] Finished 'vendorjs' after 19 ms
nodejs               | [16:05:34] Starting 'vendorcss'...
nodejs               | [16:05:34] Finished 'vendorcss' after 3.58 ms
nodejs               | [16:05:34] Starting 'fonts'...
nodejs               | [16:05:34] Starting 'configDev'...
nodejs               | [16:05:34] Finished 'configDev' after 1.95 ms
nodejs               | [16:05:35] Finished 'css' after 790 ms
nodejs               | [16:05:35] Finished 'js' after 789 ms
nodejs               | [16:05:35] Finished 'fonts' after 748 ms
nodejs               | [16:05:35] Finished 'images' after 987 ms
nodejs               | [16:05:35] Finished 'html' after 1.04 s
nodejs               | [16:05:35] Starting 'inject'...
nodejs               | [16:05:35] Finished 'inject' after 4.11 ms
nodejs               | [16:05:35] Finished 'dev' after 1.28 s
nodejs               | [16:05:35] Starting 'lint'...
nodejs               | [16:05:35] gulp-inject 11 files into base.html.
nodejs               | [16:05:36] Finished 'lint' after 1.05 s
nodejs               | [16:05:36] Starting 'connect'...
nodejs               | [16:05:36] Starting server...
nodejs               | [16:05:36] Finished 'connect' after 2.85 ms
nodejs               | [16:05:36] Starting 'watch'...
nodejs               | [16:05:40] Finished 'watch' after 4.03 s
nodejs               | [16:05:40] Starting 'test:watch'...
nodejs               | [16:05:40] Server started http://0.0.0.0:8888
nodejs               | [16:05:40] Running server
```

Can you please try the above commands and let me know if this works for you? Also, if possible, please share the error logs. 

@deshraj  Thanks for the quick response. Actually I pulled the latest change and build it again before posting the log file, and it seems the error is gone and the app works fine. I will close this issue with this comment. Thanks again.

Awesome. I am glad that it worked. :)