-
Install rosetta:
softwareupdate --install-rosetta -
To check architecture mode in shell:
arch-
x86_64/x64 mode:
i386 -
arm64 mode:
arm64
-
-
To open shell in x86 mode:
arch -x86\_64 zsh- Alternatively, you can enable the “Open with Rosetta” in the application “get info” options
-
When using nvm to install node version, append this option:
--shared-zlib
-
To install in each mode, open a shell with the arch command ^
-
Installed in x86 mode:
/usr/local/bin/brew -
Installed in arm64 mode:
/opt/homebrew/bin/brew
Node.js version 16 introduced compatibility for m1 apple silicon, so node versions before v16 need to be installed in x86_64 architecture mode.
When installing nvm, see the nvm github readme page section on “Macs with M1 chip”: https://github.com/nvm-sh/nvm
-
Install node.js version 12.22.12:
nvm install 12.22.12 --shared-zlib -
Check node architecture:
node -p process.arch -
Of course, we don’t forget how to list global packages:
npm list --global --depth 0
Before trying to install the old version that actually works(v3.6.2), don’t forget to setup git global config:
git config --global url."https\://github".insteadOf git://github
Then you should be able to install stencil-cli:
npm install -g @bigcommerce/stencil-cli\@3.6.2 --verbose
When installing npm packages in a project, some people in forums have said using this option helps: npm install --target\_arch=x64