✨ 문제 상황
Electron 앱을 Windows에서 실행할 수 있는 설치파일로 만들기 위해 Electron Forge의 make 명령어를 실행했습니다.
npm run make
하지만 Windows용 설치파일을 만드는 과정에서 다음과 같은 오류가 발생했습니다.
Authors is required.
npm run make 명령 자체가 잘못된 것은 아니었고, 앱 패키징까지는 정상적으로 진행된 후 Windows용 Squirrel 설치파일을 만드는 과정에서 오류가 발생했습니다.
C:\electron-app>npm run make
> electron-app@1.0.0 make
> electron-forge make
✔ Checking your system
✔ Loading configuration
✔ Resolving make targets
› Making for the following targets:
✔ Running package command
✔ Preparing to package application
✔ Running packaging hooks
✔ Running generateAssets hook
✔ Running prePackage hook
✔ Packaging application
✔ Packaging for x64 on win32 [3s]
✔ Running postPackage hook
✔ Running preMake hook
❯ Making distributables
✖ Making a squirrel distributable for win32/x64
› Failed with exit code: 1
Output:
'electron_app.nuspec' Ű ϰ ֽ ϴ .
Authors is required.
◼ Running postMake hook
An unhandled rejection has occurred inside Forge:
Error: Failed with exit code: 1
Output:
'electron_app.nuspec' Ű ϰ ֽ ϴ .
Authors is required.
at ChildProcess.<anonymous> (C:\electron-app\node_modules\electron-winstaller\lib\spawn-promise.js:48:24)
at ChildProcess.emit (node:events:524:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1104:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
C:\electron-app>
❗️ 오류 내용
터미널에서는 다음과 같은 메시지를 확인할 수 있었습니다.
Making a squirrel distributable for win32/x64
Failed with exit code: 1
Authors is required.
즉, Electron Forge가 Windows용 Squirrel 설치파일을 생성하는 과정에서 author 정보가 필요하다는 의미였습니다.
🔍 원인 확인
프로젝트의 package.json 파일을 확인해보니 author 항목이 비어 있었습니다. (author 항목이 없는 경우에도 발생)
{
"name": "electron-app",
"version": "1.0.0",
"author": ""
}
Electron Forge에서 Windows용 Squirrel 설치파일을 생성할 때 작성자 정보가 필요하기 때문에 발생한 오류였습니다.
🛠️ 해결 방법
package.json의 author 항목에 작성자 정보를 입력합니다.
예를 들어 다음과 같이 작성할 수 있습니다.
{
"name": "electron-app",
"version": "1.0.0",
"author": "author"
}
작성 후 파일을 저장합니다.
그리고 다시 npm run make를 실행합니다.
npm run make
정상적으로 실행되면 Electron Forge가 Windows용 배포 파일을 생성합니다.
✅ 해결 결과
다시 npm run make를 실행하니 오류 없이 Windows용 설치파일 생성이 완료되었습니다.
프로젝트의 out 폴더에서 생성된 파일을 확인할 수 있습니다.
out
└─ make
└─ squirrel.windows
└─ x64
├─ program-1.0.0 Setup.exe
└─ ...
이때 Setup.exe 파일을 실행하면 Windows에 Electron 앱을 설치할 수 있습니다.
이번 오류는 Electron 앱 자체의 코드 문제라기보다는 Electron Forge에서 Windows용 Squirrel 설치파일을 생성하는 과정에서 author 정보가 비어 있어서 발생한 오류였습니다.