0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

no such file or directory: '/usr/local/lib/libpng16.a'

Posted at

こんな時どうする

M2 Macで npm install した際にエラーが出た

npm ERR! clang: error: no such file or directory: '/usr/local/lib/libpng16.a'

インストール済みのlibpngの情報を確認

brew info libpng
==> libpng: stable 1.6.40 (bottled), HEAD
Library for manipulating PNG images
http://www.libpng.org/pub/png/libpng.html
/opt/homebrew/Cellar/libpng/1.6.40 (27 files, 1.3MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-11-01 at 09:13:47
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lib/libpng.rb
License: libpng-2.0
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 87,440 (30 days), 286,007 (90 days), 722,366 (365 days)
install-on-request: 5,011 (30 days), 15,346 (90 days), 35,485 (365 days)
build-error: 20 (30 days)

→バージョンは 1.6.40

シンボリックリンクを作成

# ディレクトリが無ければ作成
sudo mkdir -p /usr/local/lib

# シンボリックリンク作成
sudo ln -s /opt/homebrew/Cellar/libpng/1.6.40/lib/libpng16.a /usr/local/lib/libpng16.a
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?