例外の説明:
pkg . -t node16-win --out-path dist
実行エラーは次のとおりです。
> pkg . -t node16-win --out-path dist
> pkg@5.7.0
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\notifu\notifu.exe
%2: path-to-executable/notifier/notifu.exe
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\notifu\notifu64.exe
%2: path-to-executable/notifier/notifu64.exe
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\terminal-notifier.app\Contents\MacOS\terminal-notifier
%2: path-to-executable/notifier/terminal-notifier
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\snoreToast\snoretoast-x64.exe
%2: path-to-executable/notifier/snoretoast-x64.exe
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\snoreToast\snoretoast-x86.exe
%2: path-to-executable/notifier/snoretoast-x86.exe
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\snoreToast\snoretoast-x64.exe
%2: path-to-executable/notifier/snoretoast-x64.exe
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\snoreToast\snoretoast-x86.exe
%2: path-to-executable/notifier/snoretoast-x86.exe
解決策:ファイルの印刷パス
を確認してください。pkg パッケージ化前の実行パス: pkg パッケージ化後の実行パス:\node_modules\node-notifier\notifiers\toaster.js
notifier
\node_modules\node-notifier\vendor\snoreToast\snoretoast
dist\notifier
解決策:のディレクトリsnoretoast
にコピーします。パッケージ化後のファイルの場所:dist
node_modules
ファイルの場所をダウンロードします。