so I am trying to get gulp to run on my M1 MacBook Pro with little success so far.
I have tried a whole bunch of things from deleting the package.json to trying to install with sudo but everything gives me this error.
gulp error message:
so I am trying to get gulp to run on my M1 MacBook Pro with little success so far.
I have tried a whole bunch of things from deleting the package.json to trying to install with sudo but everything gives me this error.
gulp error message:
This is what worked for me.
The solution was to change the architecture of my shell from arm64 to x86.
Macs with M1 chip
January 2021: there are no pre-compiled NodeJS binaries for versions prior to 15.x for Apple's new M1 chip (arm64 architecture).
Some issues you may encounter:
$ NODE_OPTIONS="--max-old-space-size=4096" ./node_modules/.bin/your_node_package
One solution to this issue is to change the architecture of your shell from arm64 to x86.
Let's assume that:
//# Check what version you're running:
$ node --version
v14.15.4
//# Check architecture of the `node` binary:
$ node -p process.arch
arm64
//# This confirms that the arch is for the M1 chip, which is causing the problems.
//# So we need to uninstall it.
//# We can't uninstall the version we are currently using, so switch to another version:
$ nvm install v12.20.1
//# Now uninstall the version we want to replace:
$ nvm uninstall v14.15.4
//# Launch a new zsh process under the 64-bit X86 architecture:
$ arch -x86_64 zsh
//# Install node using nvm. This should download the precompiled x64 binary:
$ nvm install v14.15.4
//# Now check that the architecture is correct:
$ node -p process.arch
x64
//# It is now safe to return to the arm64 zsh process:
$ exit
//# We're back to a native shell:
$ arch
arm64
//# And the new version is now available to use:
$ nvm use v14.15.4
Now using node v14.15.4 (npm v6.14.10)
*source: Failed to "nvm install 8.0.0" source: https://github.com/nvm-sh/nvm