webiny-js
webiny-js copied to clipboard
Install node modules fails on arm architecture
Version
5.24.0
Operating System
MacOS on Apple Silicon
Browser
Not a browser issue
What steps will reproduce the bug?
Install node modules. It fails due to puppeteer can't be build on arm architecture
What is the expected behavior?
Node modules are installed successfully.
What do you see instead?
Node module installation fails
Additional information
Puppeteer npm package can't be built on arm architecture.

Possible solution
There is an option to install packages using Rosetta2. To do so you can follow this instruction. But I think it's not the best solution because I'm sure a lot of people use the cmd line from IDE, for example, where you can't run it using Rosetta.
Hi! Thanks for submitting this issue ... could you give us a bit more information here ... I have successfully installed node modules a few times successfully on an M1 Mac, so I'm wondering if there's something else going on here.
@endymion1818 See this thread for more information https://webiny-community.slack.com/archives/C014Y0HGJ0Y/p1646675978020979
Hi! Thanks for submitting this issue ... could you give us a bit more information here ... I have successfully installed node modules a few times successfully on an M1 Mac, so I'm wondering if there's something else going on here.
Have you done it on 5.24.0? It does not appear before this.
➜ blog-for-frontend-starter-kits git:(master) yarn webiny --version
5.24.0

I have, but I believe its because I installed it whilst in a terminal running Rosetta
➜ ~ node -v
v14.19.0
➜ ~ node
Welcome to Node.js v14.19.0.
Type ".help" for more information.
> require("process").arch
'x64'
Otherwise if you see arm64 when you enter require("process").arch into the node repl you aren't running Rosetta.
Here's how to open a terminal in Rosetta once its installed if it helps:
If you do that and then install the Node binary we believe you should be able to install dependencies.. I'm afraid the other solution is a lot more complex because we're not sure which dependency of puppeteer would need to be updated in order to work natively.
I have, but I believe its because I installed it whilst in a terminal running Rosetta
➜ ~ node -v v14.19.0 ➜ ~ node Welcome to Node.js v14.19.0. Type ".help" for more information. > require("process").arch 'x64'Otherwise if you see
arm64when you enterrequire("process").archinto the node repl you aren't running Rosetta.Here's how to open a terminal in Rosetta once its installed if it helps:
![]()
If you do that and then install the Node binary we believe you should be able to install dependencies.. I'm afraid the other solution is a lot more complex because we're not sure which dependency of puppeteer would need to be updated in order to work natively.
Thanks endymion1818. Ostap - let's discuss whether this can get you past this or it will have other ramifications elsewhere.
Another option is to override Puppeteer's setup behavior as described in this Slack Overflow answer.
- Install chromium via homebrew:
brew install chromium - Set the following environment variables in your shell config (e.g.,
.zshrcor.bashrc`)
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`
Now the install should pass.
Instead of assigning ENV variables, I found a better way, using puppeteer-core package, which by definition doesn't download binaries. That's exactly what we need, since we don't even need those binaries locally.
@BenjaminButon take a look at this and let's see if this gets you past it.