无法在运行 Big Sur 的新 MacBook 上运行 git
当我尝试运行 git 时,我收到以下错误:xcrun:错误:无法加载 libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): could not use '/Library/Developer /CommandLineTools/usr/lib/libxcrun.dylib',因为它不是兼容的架构)。
我遵循了强制加载哪个架构的方法,建议here,但仍然遇到错误
现在,在运行该建议后,我看到以下错误:'manpath:错误:无法加载 libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 5): 找不到合适的图像。找到了:/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib:mach-o,但架构错误 /Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib:mach-o,但架构错误)。
我还在该错误消息之前安装了 home-brew,尽管我不知道这有什么关系。
我真的缺乏与 Xcode 交互的经验。我觉得在我以前的 Mac 上,我只是能够启动并运行,没有任何这些麻烦,但已经有一段时间了,所以我可能忘记了。
如何确定 Xcode 和命令行工具是否已正确安装?如果不是,推荐的添加方式是什么?
编辑:我尝试安装自制软件以查看是否可以将其用作解决方法,并尝试使用它来安装 git,但收到以下错误:
'brew install git 正在更新 Homebrew... 错误:无法在 Intel 默认前缀 (/usr/local) 的 ARM 处理器上的 Homebrew 中安装!请使用以下“替代安装”之一在 /opt/homebrew 中创建新安装:https : //docs.brew.sh/Installation'
我正在使用带有新 M1 芯片的 Macbookpro - 这可能相关吗?
当我尝试为 mini-css-extract-plugin 使用加载器时,webpack 返回以下错误:
/node_modules/mini-css-extract-plugin/dist/loader.js:122
for (const asset of compilation.getAssets()) {
^
TypeError: compilation.getAssets(...) is not a function or its return value is not iterable
Run Code Online (Sandbox Code Playgroud)
我需要插件并在我的 prod 配置文件中调用加载程序:
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const path = require("path");
const common = require("./webpack.common");
const merge = require("webpack-merge");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = merge(common, {
mode: "production",
output: {
filename: "[name].[contentHash].bundle.js",
path: path.resolve(__dirname, "dist")
},
plugins: [
new MiniCssExtractPlugin({filename: "[name].[contentHash].css"}),
new CleanWebpackPlugin()
],
module: {
rules: [
{
test: /\.scss$/,
use: …Run Code Online (Sandbox Code Playgroud) 我通过自制软件安装了 nvm,但是当我运行 nvm -v 或 nvm --version 表单终端时,我收到消息命令未找到:nvm。当我查看 finder 和 cmd+shift+ 时。我可以看到 ~/.nvm 文件夹。
最初我的用户目录中没有 .bash_profile,所以我添加了一个和命令来根据这篇文章识别 nvm: Brew install nvm。nvm:找不到命令
然而,这并没有解决问题。我以前安装 nvm 时没有遇到过这个问题,这里会发生什么?
我在 macOS Catalina 10.15.6 上
macos ×2
terminal ×2
apple-m1 ×1
bash ×1
command-line ×1
git ×1
javascript ×1
node.js ×1
nvm ×1
webpack ×1