NodeJS dyld:延迟符号绑定失败

liwlm1x9  于 2023-01-12  发布在  Node.js
关注(0)|答案(1)|浏览(223)

当我试图在一个新创建的gatsby项目中运行gatsby develop时,我遇到了一个奇怪的错误。
这应该与gatsby.js(静态站点生成器)没有任何关系,因为我在不同的场合也遇到过同样的错误。
当我在我的一个旧项目中运行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
如果您需要任何进一步的信息,请告诉我。
先谢谢你。
我在网上搜索了这个错误,到目前为止,建议的操作都没有起作用。
卸载并重新安装夏普没有解决这个问题。
卸载并重新安装节点未解决此问题。

hjzp0vay

hjzp0vay1#

依赖项名称sharp的版本存在问题。
将package.lock.json文件或yarn.lock文件更新为使用sharp版本“0.31.1”。

以下是具体操作
在yarn.lock.json文件中替换

1.从“0.31.2”升为“0.31.1”
1.尖锐度@0.31.2:锐化至0.31.1

Yarn安装

这解决了我关于mac Catalina 10. 15的问题

相关问题