繁体   English   中英

dyld:惰性符号绑定失败

[英]dyld: lazy symbol binding failed

当我尝试在新创建的 gatsby 项目中运行gatsby develop时,我遇到了一个奇怪的错误。

这应该与 gatsby.js(一个 static 网站生成器)没有任何关系,因为我在不同的场合也遇到过同样的错误。

当我在我的一个旧项目中运行gatsby develop时,不会发生此错误。

~/Code/hzr (master) » gatsby develop                                           
success compile gatsby files - 0.996s
success load gatsby config - 0.076s
⠋ load plugins
dyld: lazy symbol binding failed: Symbol not found: _pthread_jit_write_protect_supported_np
  Referenced from: /Users/hzr/Code/hzr/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _pthread_jit_write_protect_supported_np
  Referenced from: /Users/hzr/Code/hzr/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
  Expected in: /usr/lib/libSystem.B.dylib

当我尝试启动一个 strapi 项目时,我也遇到了同样的错误:


~ » npx create-strapi-app@latest my-project --quickstart                                                              hzr@badlands
Creating a quickstart project.
Creating a new Strapi application at /Users/hzr/my-project.
Creating files.
Dependencies installed successfully.

Your application was created at /Users/hzr/my-project.

Available commands in your project:

  npm run develop
  Start Strapi in watch mode. (Changes in Strapi project files will trigger a server restart)

  npm run start
  Start Strapi without watch mode.

  npm run build
  Build Strapi admin panel.

  npm run strapi
  Display all available commands.

You can start by doing:

  cd /Users/hzr/my-project
  npm run develop

Running your Strapi application.

> my-project@0.1.0 develop
> strapi develop

Building your admin UI with development configuration...
Admin UI built successfully
dyld: lazy symbol binding failed: Symbol not found: _pthread_jit_write_protect_supported_np
  Referenced from: /Users/hzr/my-project/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _pthread_jit_write_protect_supported_np
  Referenced from: /Users/hzr/my-project/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
  Expected in: /usr/lib/libSystem.B.dylib

有谁知道什么可能导致此错误?

我使用的是 MacOS Catalina 版本 10.15.7

如果您需要任何进一步的信息,请告诉我。

提前谢谢你。

到目前为止,我在网上搜索了错误,但所有建议的操作都没有奏效。

卸载并重新安装 sharp 并不能解决问题。

卸载并重新安装节点没有解决问题。

问题出在依赖名称 sharp 的版本上。

更新您的 package.lock.json 文件或 yarn.lock 文件以使用 sharp 版本为“0.31.1”。

这是如何做的。

在 yarn.lock.json 文件中替换

  1. 尖锐的“0.31.2”到尖锐的“0.31.1”
  2. sharp@0.31.2: 到 sharp@0.31.1

纱线安装

这解决了我在 mac catalina 10.15 上的问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM