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

Cannot install on arm #627

Closed
EdwardMoyse opened this issue Nov 21, 2023 · 4 comments
Closed

Cannot install on arm #627

EdwardMoyse opened this issue Nov 21, 2023 · 4 comments

Comments

@EdwardMoyse
Copy link
Collaborator

The failure mode is:

➤ YN0009: │ canvas@npm:2.11.2 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/j6/cv3xx2910nx_pg7v2t8czqzc0000gn/T/xfs-34791f8f/build.log)
➤ YN0009: │ gl@npm:6.0.2 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/j6/cv3xx2910nx_pg7v2t8czqzc0000gn/T/xfs-d881d6fe/build.log)
➤ YN0007: │ nx@npm:16.6.0 [73c33] must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1m 37s

I have tried:

brew install pkg-config cairo pango libpng jpeg giflib librsvg

as proposed here: https://stackoverflow.com/questions/74239415/unable-to-install-node-canvas-on-m1-mac

But this didn't work. I think it MIGHT be related to c++17, but the instructions to:

# For macOS Ventura you may need to specify C++ version, e.g. yarn install -std=c++17

no longer work:

phoenix % yarn install -std=c++17
Unknown Syntax Error: Invalid option name ("-std=c++17").
@EdwardMoyse
Copy link
Collaborator Author

I think this comes from jsroot:

└─ jsroot@npm:7.6.0
   └─ canvas@npm:2.11.2 (via npm:^2.11.2)

In a fresh directory, I can install just fine with npm:

npm install jsroot
emoyse@macminim1umass Temp % ls node_modules/canvas 
CHANGELOG.md	binding.gyp	build		index.js	package.json	types
Readme.md	browser.js	changes		lib		src		util

So I'm unsure what the problem is with ARM (btw I also tried on a non-mac arm machine, and had the same issues)

@EdwardMoyse EdwardMoyse changed the title Cannot install on M1 mac Cannot install on arm Mar 14, 2024
@EdwardMoyse
Copy link
Collaborator Author

EdwardMoyse commented Mar 14, 2024

Tried with:

export CXXFLAGS="-stdlib=libc++"

from here. With this recipe, I can install a native module that depends on node-gyp, without problems)

But yarn install of phoenix fails with the usual error.

I tried also:

npm_config_target_arch=arm64 npm_config_target_platform=linux npm_config_target_libc=glibc yarn install

from here with no luck (same error - but to be clear, this isn't quite the same thing ... it seems to be more about cross compilation).

Edit: I also tried

npm_config_target_arch=arm64 npm_config_target_platform=linux npm_config_target_libc=libc++ yarn install

i.e. with npm_config_target_libc=libc++

@EdwardMoyse
Copy link
Collaborator Author

EdwardMoyse commented Mar 21, 2024

Okay, I think this works on node v18, but not with v21.

@EdwardMoyse
Copy link
Collaborator Author

Version Result
v18.19.1 Succeeds
v20.11.1 Succeeds
v21.7.1 Fails

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

1 participant