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

ARM 64 - node sass issue #596

Closed
JeffKatzy opened this issue Feb 23, 2022 · 4 comments
Closed

ARM 64 - node sass issue #596

JeffKatzy opened this issue Feb 23, 2022 · 4 comments

Comments

@JeffKatzy
Copy link

JeffKatzy commented Feb 23, 2022

I followed the tutorial for installing tutor with arm-64 here (including running the tutor dev dc build lms command).

When I get to the final step, tutor dev start, I run into the following error.

#12 74.70 gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
#12 74.70 gyp ERR! stack     at PythonFinder.failNoPython (/openedx/app/node_modules/node-gyp/lib/configure.js:484:19)
#12 74.70 gyp ERR! stack     at PythonFinder.<anonymous> (/openedx/app/node_modules/node-gyp/lib/configure.js:406:16)
#12 74.70 gyp ERR! stack     at F (/openedx/app/node_modules/which/which.js:68:16)
#12 74.70 gyp ERR! stack     at E (/openedx/app/node_modules/which/which.js:80:29)
#12 74.70 gyp ERR! stack     at /openedx/app/node_modules/which/which.js:89:16
#12 74.70 gyp ERR! stack     at /openedx/app/node_modules/isexe/index.js:42:5
#12 74.70 gyp ERR! stack     at /openedx/app/node_modules/isexe/mode.js:8:5
#12 74.70 gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:168:21)
#12 74.70 gyp ERR! System Linux 5.10.76-linuxkit
#12 74.70 gyp ERR! command "/usr/local/bin/node" "/openedx/app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
#12 74.70 gyp ERR! cwd /openedx/app/node_modules/node-sass
#12 74.70 gyp ERR! node -v v12.22.10
#12 74.70 gyp ERR! node-gyp -v v3.8.0
#12 74.70 gyp ERR! not ok
...
#12 75.87 npm ERR! [email protected] postinstall: `node scripts/build.js`
#12 75.87 npm ERR! Exit status 1
#12 75.87 npm ERR!
#12 75.87 npm ERR! Failed at the [email protected] postinstall script.

I believe this is related to the following.

I am not sure if the Can't find Python executable "python", you can set the PYTHON env variable. is another issue.

@JeffKatzy
Copy link
Author

Was able to get further by changing the dockerfile to perform a find and replace on node-sass in the package.json file with the following:

# Install nodejs requirements
ARG NPM_REGISTRY=https://registry.npmjs.org/
COPY --from=code /openedx/edx-platform/package.json /openedx/edx-platform/package.json
WORKDIR /openedx/edx-platform

RUN sed -i 's/.*node-sass.*/"sass": "^1.49.8",/' /openedx/edx-platform/package.json

RUN npm install --verbose --registry=$NPM_REGISTRY

However, now I run into the following issue when performing tutor local start.

=> CANCELED [account 3/3] RUN bash -c "set -a && source /  601.2s
 => ERROR [profile 3/3] RUN bash -c "set -a && source /ope  601.0s
------
 > [profile 3/3] RUN bash -c "set -a && source /openedx/env/production && source /openedx/env/production.override && npm run build":
#73 0.575
#73 0.575 > @edx/[email protected] build /openedx/app
#73 0.575 > fedx-scripts webpack
#73 0.575
#73 0.680 Running with resolved config:
#73 0.680 /openedx/app/node_modules/@edx/frontend-build/config/webpack.prod.config.js
#73 0.680
#73 599.8 Killed
#73 600.7 npm ERR! code ELIFECYCLE
#73 600.7 npm ERR! errno 137
#73 600.7 npm ERR! @edx/[email protected] build: `fedx-scripts webpack`
#73 600.7 npm ERR! Exit status 137
#73 600.7 npm ERR!
#73 600.7 npm ERR! Failed at the @edx/[email protected] build script.
#73 600.7 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#73 600.8
#73 600.8 npm ERR! A complete log of this run can be found in:
#73 600.8 npm ERR!     /root/.npm/_logs/2022-02-24T20_40_13_217Z-debug.log
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c bash -c "set -a && source /openedx/env/production && source /openedx/env/production.override && npm run build"]: exit code: 137
Error: Command failed with status 17: docker-compose -f /Users/jeffreykatz/Library/Application Support/tutor/env/local/docker-compose.yml -f /Users/jeffreykatz/

@jigsawlabs-student
Copy link

Potentially fixed the above by installing tutor-mfe, with the fix to the dockerfile described here. However, now running into a new error.

73 39.79 ERROR in ./src/index.scss
#73 39.79 Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
#73 39.79 ModuleBuildError: Module build failed (from ./node_modules/image-webpack-loader/index.js):
#73 39.79 Error: Cannot find module 'gifsicle'
#73 39.79 Require stack:
#73 39.79 - /openedx/app/node_modules/imagemin-gifsicle/index.js

Found this related stackoverflow, but still working to resolve.

@yarons
Copy link

yarons commented Feb 26, 2022

#73 39.79 Error: Cannot find module 'gifsicle'
#73 39.79 Require stack:
#73 39.79 - /openedx/app/node_modules/imagemin-gifsicle/index.js

Found this related stackoverflow, but still working to resolve.

There's definitely an ARM64 binary:
https://packages.ubuntu.com/jammy/gifsicle
But, if you'll click to the "arm64" link you'll end up in a page saying that it's not in the repository:
https://packages.ubuntu.com/jammy/arm64/gifsicle/download

The solution is to track down the Launchpad build process and get the deb files from its artifacts:
https://launchpad.net/ubuntu/+source/gifsicle/1.93-2/+build/22295342

Since there are no complicated dependencies you should have the binary installed pretty easily, but that's just half the story.

In that case I'm seeing some peculiar stuff:
imagemin/gifsicle-bin#124 (It's not a real dependency, it's just Unicode garbage).
https://www.npmjs.com/package/gifsicle (I'm trying to understand if this package is really needed as it's executing the gifsicle binary directly).
I'm trying to think if there's anything that can be done in that aspect with Node 12.

@regisb
Copy link
Contributor

regisb commented Mar 10, 2022

Guys, please discuss your issues in the forum. Do not use GitHub issues to troubleshoot your installation. Come back to GitHub once you have identified a precise problem. See: https://docs.tutor.overhang.io/troubleshooting.html

@regisb regisb closed this as completed Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants