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

Fix Mac compatibility issues caused by the node-sass in Mac arm processors #340

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

marcelosalloum
Copy link
Contributor

What

Fix Mac compatibility issues caused by the node-sass in Mac arm processors.

Why

When attempting to run yarn install, the node-sass package returns the following error, when executing from a ac with arm processor:

[4/4] 🔨  Building fresh packages...
[-/3] ⠠ waiting...
[2/3] ⠠ node-sass
error /Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: /Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass
Output:
Binary found at /Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass/vendor/darwin-arm64-108/binding.node
Testing binary
Binary has a problem: Error: dlopen(/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass/vendor/darwin-arm64-108/binding.node, 0x0001): tried: '/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass/vendor/darwin-arm64-108/binding.node' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass/vendor/darwin-arm64-108/binding.node' (no such file), '/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass/vendor/darwin-arm64-108/binding.node' (not a mach-o file)
    at Module._extensions..node (node:internal/modules/cjs/loader:1338:18)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at module.exports (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass/lib/binding.js:19:10)
    at Object.<anonymous> (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-sass/lib/index.js:13:35)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32) {
  code: 'ERR_DLOPEN_FAILED'
}
Building the binary locally
Building: /Users/marcelosantos/.nvm/versions/node/v18.16.0/bin/node /Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/wide-align/align.js:2
var stringWidth = require('string-width')
                  ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/string-width/index.js from /Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/wide-align/align.js not supported.
Instead change the require of index.js in /Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/wide-align/align.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/wide-align/align.js:2:19)
    at Object.<anonymous> (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/gauge/lib/render-template.js:2:13)
    at Object.<anonymous> (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/gauge/lib/plumbing.js:3:22)
    at Object.<anonymous> (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/gauge/lib/index.js:2:16)
    at Object.<anonymous> (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/npmlog/lib/log.js:3:13)
    at Object.<anonymous> (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-gyp/lib/node-gyp.js:5:13)
    at Object.<anonymous> (/Users/marcelosantos/Workspace/stellar-demo-wallet/node_modules/node-gyp/bin/node-gyp.js:8:13) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v18.16.0

@marcelosalloum marcelosalloum self-assigned this Jan 12, 2024
@stellar-jenkins
Copy link

Copy link

@marwen-abid marwen-abid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works on M1

@marcelosalloum marcelosalloum merged commit e47aed6 into master Jan 12, 2024
2 checks passed
@marcelosalloum marcelosalloum deleted the fix/mac-M-series-compatibility-issue branch January 12, 2024 20:02
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

Successfully merging this pull request may close these issues.

4 participants