Ala*_*aie 8 javascript node.js vue.js yarnpkg apple-m1
我刚刚从 Windows 10 切换到在最新 Apple M1 Silicon 上运行的 Mac 操作系统。
这是我在 Mac 上的第一个项目,我安装了homebrew并用它来安装节点和纱线:
brew install node
brew install yarn
yarn global add @vue/cli
Run Code Online (Sandbox Code Playgroud)
我的 Vue 项目在 Windows 和 Linux 上都运行良好,将其克隆到我的 Macbook 上,然后运行yarn以安装依赖项(一切照常),然后尝试在开发模式下运行该应用程序:
yarn serve
Run Code Online (Sandbox Code Playgroud)
但每次运行时我都会收到随机的“断言失败”错误yarn serve,每次都是不同的文件,但错误消息和上下文相同:
/node_modules/axios/lib/helpers/buildURL.jsAssertion failed: (thread_id_key != 0x7777), function find_thread_id_key, file ../src/coroutine.cc, line 134.
error Command failed with signal "SIGABRT".
Run Code Online (Sandbox Code Playgroud)
这是什么原因造成的?尝试过谷歌搜索,但正如我所想,几乎什么也没找到!
我已经设法解决了这个问题。
问题是依赖项之一(节点光纤)与 Nodejs v16.0.0 或更高版本不兼容。
所以解决方案是卸载node并安装NVM以使用Node v15。
首先必须卸载 Yarn & Node:
brew uninstall yarn
brew uninstall node
Run Code Online (Sandbox Code Playgroud)
然后安装NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
Run Code Online (Sandbox Code Playgroud)
之后我安装了 Node v15(或您喜欢的任何版本):
nvm install v15
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4770 次 |
| 最近记录: |