0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【環境構築】installer: Error - the package path specified was invalid: 'swift-x.y.z.pkg'

Last updated at Posted at 2025-10-30

概要

  • ターミナルアプリからswift-x-y-z.pkgをダウンロードした際に表題のエラーが発生する

取り組もうとしたこと

  • swift-x.y.z.pkgのダウンロード
  • CurrentUserHomeDirectoryは任意のディレクトリを指定済
$ installer -pkg swift-x.y.z.pkg -target CurrentUserHomeDirectory

発生した不具合

  • Swiftの公式サイトからコマンドをコピペしてもそんなパッケージは見つからないと言われている模様

installer: Error - the package path specified was invalid: 'swift-x.y.z.pkg'

解消手順

1. curlコマンドを使って直接インストール

  • 下記のサイトにインストールガイドがあるため、そのままコピペしてダウンロードする。
  • コピーするコードはLinux, Mac, Windowsから選べる

curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \
~/.swiftly/bin/swiftly init --quiet-shell-followup && \
. "${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh" && \
hash -r

参考

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?