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

The Dockerfile fails at 'npm install' #115

Closed
Oni opened this issue Sep 4, 2023 · 6 comments
Closed

The Dockerfile fails at 'npm install' #115

Oni opened this issue Sep 4, 2023 · 6 comments
Assignees
Labels
Milestone

Comments

@Oni
Copy link

Oni commented Sep 4, 2023

If I try to docker build --tag=seven23:v1.2.0 -f Dockerfile . on the version of the repo tagged with 'v1.2.0', the build fails at the npm install stage. The building process complains that python is missing. Here is the final section of the log:

Installing Cypress (version: 12.17.4)

✔  Downloaded Cypress
✔  Unzipped Cypress
✔  Finished Installation /root/.cache/Cypress/12.17.4

You can now open Cypress by running: node_modules/.bin/cypress open

https://on.cypress.io/installing-cypress


> node-sass@9.0.0 postinstall /app/node_modules/node-sass
> node scripts/build.js

Binary found at /app/node_modules/node-sass/vendor/linux_musl-x64-72/binding.node
Testing binary
Binary has a problem: Error: Error loading shared library /app/node_modules/node-sass/vendor/linux_musl-x64-72/binding.node: Exec format error
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:818:18)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at module.exports (/app/node_modules/node-sass/lib/binding.js:19:10)
    at Object.<anonymous> (/app/node_modules/node-sass/lib/index.js:13:35)
    at Module._compile (internal/modules/cjs/loader.js:777:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
Building the binary locally
Building: /usr/local/bin/node /app/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/usr/local/bin/node',
gyp verb cli   '/app/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@8.4.1
gyp info using node@12.7.0 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - "python3" is not in PATH or produced an error
gyp verb find Python checking if "python" can be used
gyp verb find Python - executing "python" to get executable path
gyp verb find Python - "python" is not in PATH or produced an error
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error

<more complaining here that python is missing>

gyp ERR! System Linux 4.4.302+
gyp ERR! command "/usr/local/bin/node" "/app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /app/node_modules/node-sass
gyp ERR! node -v v12.7.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @mui/x-date-pickers@5.0.20 requires a peer of date-fns@^2.25.0 but none is installed. You must install peer dependencies yourself.
npm WARN @mui/x-date-pickers@5.0.20 requires a peer of luxon@^1.28.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-redux@8.1.2 requires a peer of @types/react-dom@^16.8 || ^17.0 || ^18.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-redux@8.1.2 requires a peer of react-native@>=0.59 but none is installed. You must install peer dependencies yourself.
npm WARN @date-io/date-fns@2.17.0 requires a peer of date-fns@^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @date-io/luxon@2.17.0 requires a peer of luxon@^1.21.3 || ^2.x || ^3.x but none is installed. You must install peer dependencies yourself.  
npm WARN jest@29.6.4 requires a peer of node-notifier@^8.0.1 || ^9.0.0 || ^10.0.0 but none is installed. You must install peer dependencies yourself.npm WARN jest-cli@29.6.4 requires a peer of node-notifier@^8.0.1 || ^9.0.0 || ^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@13.3.2 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@13.3.2 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@13.3.2 requires a peer of sass-embedded@* but none is installed. You must install peer dependencies yourself.
npm WARN cosmiconfig@8.3.4 requires a peer of typescript@>=4.9.5 but none is installed. You must install peer dependencies yourself.
npm WARN @jest/core@29.6.4 requires a peer of node-notifier@^8.0.1 || ^9.0.0 || ^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN jest-config@29.6.4 requires a peer of ts-node@>=9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @jest/reporters@29.6.4 requires a peer of node-notifier@^8.0.1 || ^9.0.0 || ^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws@8.13.0 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@8.13.0 requires a peer of utf-8-validate@>=5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@9.0.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@9.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-09-04T21_56_00_719Z-debug.log

In the image I can see that python is indeed missing.

I'm running docker in a linux host machine (Synology NAS).

Do you plan to upload the client on dockerhub? I can only see seven23 server on dockerhub.

@sebastienbarbier
Copy link
Owner

Looking at it, Dockerfile seams deprecated, exact same behavior on my machine 🙈.

I'll need a few days to fix it. Working on it, assigned for a release v1.2.1

Also publishing to dockerhub sounds easy as it is just a index.html file. Will do at the same time.

@sebastienbarbier
Copy link
Owner

Version 1.2.1 has been released and should fix this issue 🥳.

You can try running docker build locally using docker build -t seven23_app -f Dockerfile . then docker run -p 8000:80 seven23_app to run.

I also published builded version as sebastienbarbier/seven23_app on hub.docker.

Let me know if any issue, will close this ticket for now and many thanks for your feedback 🙇‍♂️

@sebastienbarbier
Copy link
Owner

Builded image is corrupted 🙈, reopened will push a fix quickly

@sebastienbarbier
Copy link
Owner

Should works now 👍, had some issue with building the Dockerfile now all good.
Closing this ticket, let me know if any issue.

@Oni
Copy link
Author

Oni commented Sep 8, 2023

It works perfectly for me now. I'm using the docker hub image: it's very convenient.

@sebastienbarbier
Copy link
Owner

It works perfectly for me now. I'm using the docker hub image: it's very convenient.

🥳🥳🥳

Many thanks for your inputs 🙏, happy that I could help.

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

2 participants