Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: morphlingjs@0.1.99 postinstall: NODE_PORT=1 docker-compose build #5

Open
toumas opened this issue Nov 9, 2017 · 13 comments
Open
Assignees

Comments

@toumas
Copy link

toumas commented Nov 9, 2017

Hi there,
I'd be very interested in trying this tool out but when i run npm i -g morphlingjs I get an error stating that postinstall failed. I haven't used docker before so it could be also that.

Here's npm log:

24100 error Windows_NT 10.0.15063
24101 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-g" "morphlingjs"
24102 error node v6.10.3
24103 error npm  v3.10.10
24104 error code ELIFECYCLE
24105 error morphlingjs@0.1.99 postinstall: `NODE_PORT=1 docker-compose build`
24105 error Exit status 1
24106 error Failed at the morphlingjs@0.1.99 postinstall script 'NODE_PORT=1 docker-compose build'.
24106 error Make sure you have the latest version of node.js and npm installed.
24106 error If you do, this is most likely a problem with the morphlingjs package,
24106 error not with npm itself.
24106 error Tell the author that this fails on your system:
24106 error     NODE_PORT=1 docker-compose build
24106 error You can get information on how to open an issue for this project with:
24106 error     npm bugs morphlingjs
24106 error Or if that isn't available, you can get their info via:
24106 error     npm owner ls morphlingjs
24106 error There is likely additional logging output above.
24107 verbose exit [ 1, true ]
@vroudge
Copy link
Contributor

vroudge commented Nov 9, 2017

Hi !

Do you have docker and docker-compose available to your terminal?

@vroudge vroudge self-assigned this Nov 9, 2017
@toumas
Copy link
Author

toumas commented Nov 10, 2017

Yup.

docker -v
Docker version 17.09.0-ce, build afdb6d4
docker-compose -v
docker-compose version 1.16.1, build 6d1ac219

@vroudge
Copy link
Contributor

vroudge commented Nov 11, 2017

I don't have any Windows-based computer under the hand. If someone could try and reproduce this, that'd be cool.

@toumas Can you try to clone the repository and let me know what happens when you run the following: NODE_PORT=1 docker-compose build

@toumas
Copy link
Author

toumas commented Nov 16, 2017

Hi. Running NODE_PORT=1 docker-compose build gives me 'NODE_PORT' is not recognized as an internal or external command, operable program or batch file. error. So I tried replacing ${NODE_PORT} with 1 in docker-compose.yml and tried again but got

Building web
Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 68, in main
  File "compose\cli\main.py", line 121, in perform_command
  File "compose\cli\main.py", line 249, in build
  File "compose\project.py", line 343, in build
  File "compose\service.py", line 918, in build
  File "site-packages\docker\api\build.py", line 246, in build
  File "site-packages\docker\utils\decorators.py", line 46, in inner
  File "site-packages\docker\api\client.py", line 185, in _post
  File "site-packages\requests\sessions.py", line 522, in post
  File "site-packages\requests\sessions.py", line 475, in request
  File "site-packages\requests\sessions.py", line 596, in send
  File "site-packages\requests\adapters.py", line 423, in send
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
  File "httplib.py", line 1042, in request
  File "httplib.py", line 1082, in _send_request
  File "httplib.py", line 1038, in endheaders
  File "httplib.py", line 882, in _send_output
  File "httplib.py", line 844, in send
  File "site-packages\docker\transport\npipeconn.py", line 31, in connect
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 50, in connect
pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')
Failed to execute script docker-compose

Sorry for late reply @vroudge

@pmachart
Copy link

pmachart commented Nov 16, 2017 via email

@vroudge
Copy link
Contributor

vroudge commented Nov 16, 2017

^ What he said.

@vroudge
Copy link
Contributor

vroudge commented Nov 16, 2017

@pmachart mind sending a PR to support this?

@toumas
Copy link
Author

toumas commented Nov 17, 2017

So I did that but got this error this time around:

Building web
Step 1/12 : FROM node:8.2.1
 ---> b17af62b0dea
Step 2/12 : RUN mkdir -p /usr/app
 ---> Using cache
 ---> 385914c4f0db
Step 3/12 : WORKDIR /usr/app
 ---> Using cache
 ---> ae8e2758418f
Step 4/12 : COPY ./package.json ./
 ---> Using cache
 ---> 2af918d79829
Step 5/12 : RUN npm install
 ---> Using cache
 ---> 20f0c0afc93f
Step 6/12 : RUN npm install pm2 -g --silent
 ---> Using cache
 ---> 245256b60d15
Step 7/12 : COPY bin/src ./src
ERROR: Service 'web' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder649034724/bin/src: no such file or directory

@vroudge
Copy link
Contributor

vroudge commented Nov 17, 2017

Thank you very much for the feedback. I believe we are almost there.

You need to do the Windows equivalent of the following:

In the morphling directory:

	mkdir bin || true
	./node_modules/.bin/babel src -d bin/src
	./node_modules/.bin/babel cli -d bin/cli
	mkdir bin/src/data

and then run the docker compose command @pmachart provided you.

We will improve the Windows support in an upcoming PR as soon as possible.

@toumas
Copy link
Author

toumas commented Nov 17, 2017

So I did mkdir bin\src\data and then docker-compose build and it ran successfully.

Building web
Step 1/12 : FROM node:8.2.1
 ---> b17af62b0dea
Step 2/12 : RUN mkdir -p /usr/app
 ---> Using cache
 ---> 385914c4f0db
Step 3/12 : WORKDIR /usr/app
 ---> Using cache
 ---> ae8e2758418f
Step 4/12 : COPY ./package.json ./
 ---> Using cache
 ---> 2af918d79829
Step 5/12 : RUN npm install
 ---> Using cache
 ---> 20f0c0afc93f
Step 6/12 : RUN npm install pm2 -g --silent
 ---> Using cache
 ---> 245256b60d15
Step 7/12 : COPY bin/src ./src
 ---> 95a0420c331d
Step 8/12 : RUN mkdir -p /usr/app/src/data
 ---> Running in 52fc7862ec6e
 ---> d909e7c55e2e
Removing intermediate container 52fc7862ec6e
Step 9/12 : ARG NODE_PORT=8883
 ---> Running in c1376068aba9
 ---> 8b6a65a45802
Removing intermediate container c1376068aba9
Step 10/12 : ENV NODE_PORT $NODE_PORT
 ---> Running in 2791827b17ac
 ---> aac850580914
Removing intermediate container 2791827b17ac
Step 11/12 : EXPOSE ${NODE_PORT}
 ---> Running in 01d6412d3936
 ---> 7f1dd8722eae
Removing intermediate container 01d6412d3936
Step 12/12 : CMD pm2-docker src/server.js
 ---> Running in 13c0e96b0a13
 ---> 8dc570b759a6
Removing intermediate container 13c0e96b0a13
Successfully built 8dc570b759a6
Successfully tagged morphlingjs_web:latest

But to be honest I'm little confused how to continue from here.

@jeremieP
Copy link
Member

i think for this error, we can add the "cross-env" module to support Windows .

@vroudge

@jeremieP
Copy link
Member

a PR is opened to try to fix it.

@vroudge
Copy link
Contributor

vroudge commented Nov 23, 2017

#7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants