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

on docker-compose build, storefront give build error #43

Closed
talalsiddiqui opened this issue May 29, 2020 · 21 comments
Closed

on docker-compose build, storefront give build error #43

talalsiddiqui opened this issue May 29, 2020 · 21 comments
Labels

Comments

@talalsiddiqui
Copy link

ERROR: Service 'storefront' failed to build: The command '/bin/sh -c npm install' returned a non-zero code: 1

Kindly help me out.
Operatiing system: Ubuntu 18

@NyanKiyoshi
Copy link
Member

@talalsiddiqui can you provide use the full output? Thanks!

@talalsiddiqui
Copy link
Author

image
I am not able to find log file in system ... but i have resolved the issue, by deleting the package-lock.json file

@NyanKiyoshi
Copy link
Member

Can you provide us every step you have used to run saleor-platform?

@talalsiddiqui
Copy link
Author

Apologies for the late reply.
i have followed the exact steps which are written in Readme file

@talalsiddiqui
Copy link
Author

One thing more, if I install the storefront repo separately, then I face no issues.
but when I use this Plateform repo and do the installation then I faced the above issues.
I resolved the above issues by deleting the package-lock.json file, but still, it took me many hours to figure out.
plus as you can see on screenshot, on WORKDIR command no app folder created.

@NyanKiyoshi
Copy link
Member

Weird. I will pass it to the storefront team to look into. Outdated packages in package-lock often can cause issues.

@MahmoudGad-key
Copy link

I have the exact error in Ubuntu 16.04.6 (LTS) x64

@sah-anshu
Copy link

Successfully tagged saleor-platform_storefront:latest
Building dashboard
Step 1/13 : FROM node:10
---> e7671d9424c2
Step 2/13 : WORKDIR /app
---> Using cache
---> be35a61fb89e
Step 3/13 : COPY package*.json ./
---> Using cache
---> 035fdec0e77b
Step 4/13 : RUN npm install
---> Running in 6c2502fc94ba
npm WARN [email protected] No description

npm ERR! network timeout at: https://registry.npmjs.org/@apollographql/graphql-language-service-utils/-/graphql-language-service-utils-2.0.2.tgz

Error in Debian10

@MahmoudGad-key
Copy link

I tried to install in centos 9 and it worked

@NyanKiyoshi
Copy link
Member

image
I am not able to find log file in system ... but i have resolved the issue, by deleting the package-lock.json file

Try deleting node_modules (rm -rf node_modules), then redo.

Successfully tagged saleor-platform_storefront:latest
Building dashboard
Step 1/13 : FROM node:10
---> e7671d9424c2
Step 2/13 : WORKDIR /app
---> Using cache
---> be35a61fb89e
Step 3/13 : COPY package*.json ./
---> Using cache
---> 035fdec0e77b
Step 4/13 : RUN npm install
---> Running in 6c2502fc94ba
npm WARN [email protected] No description

npm ERR! network timeout at: https://registry.npmjs.org/@apollographql/graphql-language-service-utils/-/graphql-language-service-utils-2.0.2.tgz

Error in Debian10

Retry, check your connectivity and npm status.

@geoph9
Copy link

geoph9 commented Oct 15, 2020

I have a similar issue on fedora 32:

Screenshot from 2020-10-15 15-23-03

It still appears when building storefront and doing npm install. I have also created a /etc/docker/daemon.json file as instructed here but nothing changed. Any ideas?

@geoph9
Copy link

geoph9 commented Oct 15, 2020

So, I managed to solve my above issue by specifying the network. As far as I can tell, this is an issue with docker's embedded DNS but I am not sure about the details.

In my case, all I had to do is change the docker-compose.yml and specifically the images api, storefront, dashboard so that when building, they use host as the --network parameter. For example, my storefront section looks like the following:

  storefront:
    build:
      context: ./saleor-storefront
      dockerfile: ./Dockerfile.dev
      network: host
    ports:
      - 3000:3000
    restart: unless-stopped
    volumes:
      - ./saleor-storefront/:/app:cached
      - /app/node_modules/
    command: npm start -- --host 0.0.0.0

Anyway, I hope this will be useful to someone else in the same situation.

@NyanKiyoshi
Copy link
Member

Weird. What docker version is it? @geoph9

@geoph9
Copy link

geoph9 commented Oct 15, 2020

I use docker 19.03.11 and docker-compose 1.27.4.

It turns out that this is a firewall issue and it is known to the fedora community (I am a new user and I didn't know that). I didn't want to risk it, so I deleted docker and installed moby (as per this) and I have no issues now.

@Kamoliddin1
Copy link

Kamoliddin1 commented Oct 20, 2020

@NyanKiyoshi I have this kind of issue!
When it comes to npm install it gives this kind of WARNs
I use docker 19.03.13 docker-compose 1.27.4. node - v12.19.0 npm - 6.14.8
My os - Ubuntu 18.04
Screenshot from 2020-10-20 01-32-12

@pipoupiwam
Copy link

@NyanKiyoshi I have this kind of issue!

I also encountered this issue and solved it using this : saleor/saleor#6414 (comment)

@NyanKiyoshi
Copy link
Member

NyanKiyoshi commented Dec 28, 2020

@pipoupiwam can you provide the npm error logs? Run: docker-compose build storefront and provide us the output.

This is most likely an issue with package-lock.json. But I'm not sure whether that would be the same as above, where they had corrupted packages.

Can you also provide some additional information, if that's Linux/Unix-based:

uname -mrsv
docker -v
docker-compose -v

If that's Windows, remove that uname one.

Also, for additional context so we can reproduce, provide the Saleor-Storefront version:

  1. Change your current directory to Saleor Storefront
  2. git describe --all --long --abbrev=40

@TGalioAutomation
Copy link

same issue when work in macbook m1

@TGalioAutomation
Copy link

Uploading Screen Shot 2021-06-14 at 22.21.05.png…

@metouitude
Copy link

So, I managed to solve my above issue by specifying the network. As far as I can tell, this is an issue with docker's embedded DNS but I am not sure about the details.

In my case, all I had to do is change the docker-compose.yml and specifically the images api, storefront, dashboard so that when building, they use host as the --network parameter. For example, my storefront section looks like the following:

  storefront:
    build:
      context: ./saleor-storefront
      dockerfile: ./Dockerfile.dev
      network: host
    ports:
      - 3000:3000
    restart: unless-stopped
    volumes:
      - ./saleor-storefront/:/app:cached
      - /app/node_modules/
    command: npm start -- --host 0.0.0.0

Anyway, I hope this will be useful to someone else in the same situation.

Specifying network as host worked for me

@krzysztofwolski
Copy link
Member

network: host does not work properly on Mac, so we solved the issue by adding proxy in the storefront container

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

No branches or pull requests

10 participants