RickWong / react-isomorphic-starterkit

Create an isomorphic React app in less than 5 minutes
BSD 3-Clause "New" or "Revised" License
2.32k stars 191 forks source link

(Node 0.10) Error running in Ubuntu docker container #11

Closed kutzi closed 9 years ago

kutzi commented 9 years ago

It's probably just me being too stupid (no real node experience), but I cannot get it running in a minimal docker container. Dockerfile:

FROM ubuntu:14.10

# make sure apt is up to date
RUN apt-get update

# install nodejs and npm
RUN apt-get install -y nodejs npm git git-core

# install react-isomorphic-starterkit
RUN git clone https://github.com/RickWong/react-isomorphic-starterkit.git
RUN cd react-isomorphic-starterkit && npm install -g supervisor webpack webpack-dev-server
RUN cd react-isomorphic-starterkit && npm install

build container, run with: docker run -i -t -p 8000:8000 react_isomorphic/kutzi /bin/bash

cd react-isomorphic-starterkit/ && npm run watch =>

> eval 'npm run watch-server >tmp/server.log 2>&1 & SERVER_PID=$!';      eval 'npm run watch-client >tmp/client.log 2>&1 & CLIENT_PID=$!';     sleep 5;    npm run start;     kill $CLIENT_PID $SERVER_PID;

> react-isomorphic-starterkit@1.0.4 start /react-isomorphic-starterkit
> eval 'supervisor dist/server >tmp/supervisor.log 2>&1 & SUPERVISOR_PID=$!';     sleep 1;      open http://localhost:8000;       tail -f tmp/*.log;     kill $SUPERVISOR_PID;

Couldn't get a file descriptor referring to the console
==> tmp/client.log <==
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /react-isomorphic-starterkit/npm-debug.log
npm ERR! not ok code 0

==> tmp/server.log <==
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /react-isomorphic-starterkit/npm-debug.log
npm ERR! not ok code 0

==> tmp/supervisor.log <==
/usr/bin/env: node: No such file or directory

There's more info in the npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'watch-client' ]
2 info using npm@1.4.21
3 info using node@v0.10.25
4 verbose run-script [ 'prewatch-client', 'watch-client', 'postwatch-client' ]
5 info prewatch-client react-isomorphic-starterkit@1.0.4
6 info watch-client react-isomorphic-starterkit@1.0.4
7 verbose unsafe-perm in lifecycle true
8 info react-isomorphic-starterkit@1.0.4 Failed to exec watch-client script
9 error react-isomorphic-starterkit@1.0.4 watch-client: `webpack -cv --display-error-details --config webpack.client-watch.js && webpack-dev-server --config webpack.client-watch.js`
9 error Exit status 127
10 error Failed at the react-isomorphic-starterkit@1.0.4 watch-client script.
10 error This is most likely a problem with the react-isomorphic-starterkit package,
10 error not with npm itself.
10 error Tell the author that this fails on your system:
10 error     webpack -cv --display-error-details --config webpack.client-watch.js && webpack-dev-server --config webpack.client-watch.js
10 error You can get their info via:
10 error     npm owner ls react-isomorphic-starterkit
10 error There is likely additional logging output above.
11 error System Linux 3.13.0-24-generic
12 error command "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch-client"
13 error cwd /react-isomorphic-starterkit
14 error node -v v0.10.25
15 error npm -v 1.4.21
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]
RickWong commented 9 years ago

See: https://github.com/RickWong/react-isomorphic-starterkit/commit/cb0a4c61a049340d18207454f7c4f16af79edcb7

Instead of the command-line eval + PID-magic the starterkit now uses concurrent(ly). Does it run on Heroku now?

Also please verify that the global and project npm dependencies are completely installed.

kutzi commented 9 years ago

Thanks for the feedback. Unfortunately, doesn't look better, yet. Not sure how I can verify that the dependencies are completely installed. I tried npm-check (https://www.npmjs.com/package/npm-check), but it just exits with :/usr/bin/env: node: No such file or directory

There are a lot of warnings during npm install:

Step 5 : RUN cd react-isomorphic-starterkit && npm install
 ---> Running in 22aed0e86e3f
npm WARN engine hapi@8.2.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine heavy@3.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine items@1.1.0: wanted: {"node":">=0.10.30"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine catbox-memory@1.1.1: wanted: {"node":">=0.10.30"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine peekaboo@1.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine mimos@2.0.2: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine kilt@1.1.1: wanted: {"node":">=0.10.30"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine topo@1.0.2: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine call@2.0.1: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine accept@1.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine ammo@1.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine h2o2@4.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine statehood@2.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine iron@2.1.2: wanted: {"node":">=0.10.30"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine shot@1.4.2: wanted: {"node":">=0.10.30"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine catbox@4.2.1: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine subtext@1.0.2: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine wreck@5.2.0: wanted: {"node":">=0.10.30"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine vision@2.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine inert@2.1.3: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine joi@5.1.0: wanted: {"node":">=0.10.30"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN optional dep failed, continuing fsevents@0.3.5
npm WARN engine content@1.0.1: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine pez@1.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine b64@2.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine nigel@1.0.1: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine vise@1.0.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"

Does that mean that the node install is too old?

RickWong commented 9 years ago

Can you try with node 0.12?

kutzi commented 9 years ago

Don't know how to install 0.12 (even when using the instructions on https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager I'm still getting 0.10 But I managed to install 0.10.36 that way and that works much better. npm watch still fails - but probably unsurprisingly - when trying to open http://localhost:8000, but I can access localhost:8000 from the docker host without problems

See https://github.com/kutzi/react-isomorphic-starterkit/blob/docker/Dockerfile

ghost commented 8 years ago

@kutzi Did you managed to get watch working ?

kutzi commented 8 years ago

No, I didn't pursue this issue any longer