我的目标是安装8,这样我就可以在一个项目上运行Gulp。
我正在做一个旧的项目,这个项目被另一个开发人员忽略并交给了我。我被告知可以通过安装Node 8并在我的package.json文件中声明节点版本来使用Gulp。
但是,每当我尝试运行nvm install 8
时,我都会收到错误error: "unsupported ARM architecture"
我的系统是MacOS大Sur M1芯片
我不太确定我应该在这里做什么。请帮帮我!
发布于 2021-06-23 19:32:06
溶液
解决方案是将我的shell的体系结构从arm64更改为x86.
带M1芯片的Mac
2021年1月:苹果新的NodeJS芯片(arm64体系结构) 15.x之前的版本没有预编译的arm64二进制文件。
你可能会遇到以下一些问题:
使用nvm安装的v14.15.4:
$ NODE_OPTIONS="--max-old-space-size=4096" ./node_modules/.bin/your_node_package
解决此问题的一个解决方案是将shell的体系结构从arm64更改为x86。
让我们假设:
您已经使用nvm --install-rosetta)
//# 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)
来源:
发布于 2021-12-31 14:56:34
一般小组中的
使用罗塞塔(选择此项目)的打开✅
nvm install 8
返回到
https://stackoverflow.com/questions/68104335
复制相似问题